/* /applications and /news. Everything else comes from /css/main.css. */

.community-flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--inset);
  border: 2px solid var(--outline);
  border-left: 4px solid var(--green);
}

.community-flash-warn {
  border-left-color: var(--yellow);
}

.community-flash-error {
  border-left-color: var(--red);
}

.community-login,
.community-account,
.community-dms,
.community-subscribe {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.community-login > div,
.community-dms > div,
.community-subscribe > div {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.community-me {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.community-account img,
.community-applicant img {
  border-radius: 50%;
  box-shadow: 0 0 0 2px #000;
}

.community-account > div {
  display: flex;
  flex-direction: column;
  margin-right: auto;
}

.community-dms {
  padding-top: 14px;
  border-top: 2px solid var(--outline);
}

.community-review-link {
  align-self: flex-start;
}

.community-subscribe > i {
  font-size: 2rem;
  color: #8c95ff;
}

/* Positions */
.community-positions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.community-position {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-position p {
  flex: 1;
}

.community-position h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
}

.community-position-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  color: #000;
  background: var(--yellow);
  border: 2px solid #000;
}

.community-position.is-closed {
  opacity: 0.6;
}

/* Your applications */
.community-mine {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-mine-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--inset);
  border: 2px solid var(--outline);
  border-left: 4px solid var(--yellow);
}

.community-mine-row > div {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.community-mine-row.status-accepted { border-left-color: var(--green); }
.community-mine-row.status-denied { border-left-color: var(--red); }
.community-mine-row.status-withdrawn { border-left-color: var(--outline); opacity: 0.7; }

.community-status {
  font-family: var(--font-head);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.community-note {
  margin-top: 6px;
  color: var(--text-dim);
}

/* Form */
.community-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.community-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.community-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.community-field > span {
  font-weight: 600;
}

.community-field input,
.community-field textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--inset);
  border: 2px solid var(--outline);
  border-radius: 0;
}

.community-field textarea {
  resize: vertical;
  min-height: 90px;
}

.community-field input:focus,
.community-field textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 0;
}

.community-error {
  font-size: 0.85rem;
  color: var(--red);
}

.community-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.community-check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.community-small {
  font-size: 0.85rem;
}

.community-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Review */
.community-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.community-count {
  margin-left: 4px;
  opacity: 0.7;
}

.community-table-wrap {
  overflow-x: auto;
}

.community-table {
  width: 100%;
  border-collapse: collapse;
}

.community-table th,
.community-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 2px solid var(--outline);
  white-space: nowrap;
}

.community-who {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-who img {
  border-radius: 50%;
}

.community-applicant {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.community-applicant h2 {
  font-family: var(--font-head);
}

.community-answers {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 16px;
}

.community-answer h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: var(--yellow);
}

.community-answer p,
.community-news-body {
  overflow-wrap: anywhere;
}

/* News */
.community-subscribe {
  margin-bottom: 16px;
}

.community-news {
  margin-bottom: 16px;
  overflow: hidden;
}

.community-news h2,
.community-news h1 {
  margin: 4px 0 10px;
  font-family: var(--font-head);
}

.community-news h2 a {
  color: inherit;
  text-decoration: none;
}

.community-news h2 a:hover {
  text-decoration: underline;
}

.community-news-image {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-bottom: 2px solid var(--outline);
}

.community-news-full .community-news-image {
  max-height: none;
}

.community-news-body {
  margin-bottom: 12px;
  line-height: 1.6;
}

.community-pages,
.community-back {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}


.community-answer a,
.community-news-body a,
.community-note a {
  color: var(--green);
  text-decoration: underline;
}

/* Tick-box questions */
.community-check-q {
  padding: 12px;
  background: var(--inset);
  border: 2px solid var(--outline);
}

/* Applicant header and submission stats */
.community-applicant .community-applicant-skin {
  border-radius: 0;
  box-shadow: none;
  image-rendering: pixelated;
  background: var(--inset);
  border: 2px solid var(--outline);
}

.community-applicant-discord {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.community-applicant-discord img {
  width: 22px;
  height: 22px;
}

.community-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  text-transform: uppercase;
  color: #000;
  background: var(--green);
  border: 2px solid #000;
}

.community-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.community-stats div {
  padding: 10px 12px;
  background: var(--inset);
  border: 2px solid var(--outline);
}

.community-stats dt {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.community-stats dd {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.community-who img[src^="/skin/"] {
  border-radius: 2px;
  image-rendering: pixelated;
}

/* News: who posted it */
.news-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.news-author-skin {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--inset);
  border: 2px solid var(--outline);
}

.news-author > div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.news-author .dim {
  font-size: 0.85rem;
}

.community-news.is-latest {
  border-color: var(--yellow);
}

.community-news-media {
  display: block;
  overflow: hidden;
}

.community-news-media img {
  transition: transform 0.4s ease;
}

.community-news-media:hover img {
  transform: scale(1.02);
}

.community-back form {
  display: inline;
}

.news-write-preview {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  align-self: flex-start;
  border: 2px solid var(--outline);
}

.community-field input[type="file"] {
  padding: 8px;
}

/* /media */
.media-section {
  margin-top: 24px;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.creator-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.creator-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 var(--edge-hi), inset -2px -2px 0 var(--edge-lo);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.creator-stage {
  position: relative;
  display: grid;
  place-items: end center;
  height: 220px;
  padding-top: 12px;
  background:
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 92, 92, 0.3), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--inset));
  border-bottom: 2px solid #000;
}

.creator-card.is-featured .creator-stage {
  height: 280px;
  background:
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 210, 63, 0.35), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--inset));
}

.creator-skin {
  width: auto;
  max-width: 80%;
  height: 200px;
  object-fit: contain;
  object-position: bottom;
  image-rendering: pixelated;
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.creator-card.is-featured .creator-skin {
  height: 258px;
}

.creator-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
}

.creator-body h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
}

.creator-followers {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yellow);
}

.creator-body p {
  font-size: 0.9rem;
}

.creator-links {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.creator-links a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  background: var(--inset);
  border: 2px solid #000;
  transition: background 0.2s ease, color 0.2s ease;
}

.creator-links a:hover {
  color: #000;
  background: var(--yellow);
}

@media (hover: hover) {
  .creator-card:hover {
    transform: translateY(-4px);
    border-color: var(--yellow);
  }

  .creator-card:hover .creator-skin {
    transform: scale(1.06) rotate(-2deg);
  }
}

.media-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 16px;
  text-align: center;
}

.media-empty i {
  font-size: 2rem;
  color: var(--red);
}

.media-join {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
  border-color: var(--yellow);
}

.media-join > div {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-perks {
  display: grid;
  gap: 6px;
  list-style: none;
}

.media-perks i {
  width: 22px;
  color: var(--yellow);
}

@media (max-width: 520px) {
  .creator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .creator-stage {
    height: 180px;
  }

  .creator-skin {
    height: 162px;
  }
}

.media-hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Latest videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.video-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 var(--edge-hi), inset -2px -2px 0 var(--edge-lo);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--red);
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--inset);
  border-bottom: 2px solid #000;
}

.video-thumb {
  overflow: hidden;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-blank {
  position: absolute;
  inset: 0;
}

.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-card:hover .video-play {
  opacity: 1;
}

.video-play i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 38px;
  padding-left: 3px;
  background: #e62117;
  border: 2px solid #000;
}

.video-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.video-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  line-height: 1.35;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.video-meta img {
  image-rendering: pixelated;
  border: 1px solid #000;
}

/* Pop-up player */
.video-player {
  width: min(960px, calc(100vw - 32px));
  padding: 0;
  margin: auto;
  background: #000;
  border: 2px solid #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.video-player::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.video-player-frame {
  aspect-ratio: 16 / 9;
}

.video-player-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-player-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #000;
  cursor: pointer;
}

.community-field > span i {
  width: 18px;
}

/* Community videos and live streams */
.video-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
}

.video-badge.is-live {
  left: 6px;
  top: 6px;
  right: auto;
  bottom: auto;
  background: #e91916;
}

.video-card.is-live:hover {
  border-color: #9146ff;
}

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  vertical-align: middle;
  background: #e91916;
  border-radius: 50%;
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Staff portal */
.portal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.portal-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-left: 4px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--edge-hi), inset -2px -2px 0 var(--edge-lo);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.portal-tile:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
}

.portal-tile.is-alert {
  border-left-color: var(--yellow);
}

.portal-tile.is-warn {
  border-left-color: var(--red);
}

.portal-tile-num {
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1.1;
}

.portal-tile.is-alert .portal-tile-num {
  color: var(--yellow);
}

.portal-tile-label {
  font-weight: 700;
}

.portal-tile .dim {
  font-size: 0.8rem;
}

.portal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-note {
  margin-top: 12px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.portal-grid > .panel {
  margin: 0;
}

.portal-list {
  display: grid;
  gap: 6px;
  list-style: none;
}

.portal-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
  background: var(--inset);
  border: 2px solid var(--outline);
}

.portal-list a:hover {
  border-color: var(--yellow);
}

.portal-list img {
  flex-shrink: 0;
  image-rendering: pixelated;
  border: 1px solid #000;
}

.portal-list a > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

.portal-list .dim {
  font-size: 0.8rem;
}

.portal-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-status.is-accepted { color: var(--green); }
.portal-status.is-denied { color: var(--red); }

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

/* Endless community feed */
.is-infinite .video-card.is-queued {
  display: none;
}

.video-card.is-entering {
  animation: video-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.video-card.is-entering .video-thumb img {
  animation: video-thumb-in 0.8s ease both;
  animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}

@keyframes video-in {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes video-thumb-in {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.video-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding-top: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-loader.is-active {
  opacity: 1;
}

.video-loader span {
  width: 10px;
  height: 10px;
  background: var(--red);
  border: 2px solid #000;
  animation: loader-hop 0.9s ease-in-out infinite;
}

.video-loader span:nth-child(2) { animation-delay: 0.15s; background: var(--yellow); }
.video-loader span:nth-child(3) { animation-delay: 0.3s; background: var(--green); }

@keyframes loader-hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

.media-join {
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .video-card.is-entering,
  .video-card.is-entering .video-thumb img,
  .video-loader span {
    animation: none;
  }
}

/* Staff: hide an off-topic community video */
.video-card {
  position: relative;
}

.video-hide {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #000;
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.video-card:hover .video-hide,
.video-hide:focus {
  opacity: 1;
}

.video-hide:hover {
  background: var(--red);
}

@media (hover: none) {
  .video-hide {
    opacity: 1;
  }
}

.hidden-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--inset);
  border: 2px solid var(--outline);
}

.hidden-row > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Platform badge on community posts */
.video-platform {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.is-youtube .video-platform i { color: #ff3b30; }
.is-tiktok .video-platform i { color: #25f4ee; }
.is-reddit .video-platform i { color: #ff4500; }
.is-dailymotion .video-platform i { color: #2f8fff; }
.is-twitch .video-platform i { color: #a970ff; }
.is-kick .video-platform i { color: #53fc18; }
.is-instagram .video-platform i { color: #e1306c; }

.video-thumb-blank {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, var(--panel-2), var(--inset));
}

.is-reddit .video-thumb-blank { color: rgba(255, 69, 0, 0.5); }
.is-tiktok .video-thumb-blank { color: rgba(37, 244, 238, 0.45); }

/* TikToks and Shorts play upright */
.video-player.is-vertical {
  width: min(380px, calc(100vw - 32px));
}

.video-player.is-vertical .video-player-frame {
  aspect-ratio: 9 / 16;
  max-height: 86vh;
}

.add-post-form {
  margin-bottom: 14px;
}
