:root {
  --bone: #F4F2ED;
  --black: #000000;
  --brick-red: #B7121F;
  --emerald: #40C887;
  --indigo: #1F39FF;
  --amber: #FEB21A;
  --pacific: #53B3CB;
  --blaze: #FC6722;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background-color: var(--black);
  color: var(--bone);
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--bone);
}

nav a {
  color: var(--bone);
  text-decoration: none;
  font-size: 16px;
  margin-inline-start: 28px;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

nav a:hover,
nav a.active {
  border-color: var(--bone);
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  text-align: center;
}

.hero h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  line-height: 1.9;
  color: #b0aea8;
  margin-bottom: 40px;
}

.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.recent-section {
  max-width: 1040px;
  margin: 64px auto 0;
  padding: 0 24px 80px;
}

.recent-section h2 {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
}

.btn {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background-color: var(--bone);
  color: var(--black);
}

.btn-secondary {
  background-color: transparent;
  color: var(--bone);
  border: 2px solid var(--bone);
}

footer {
  text-align: center;
  padding: 60px 24px 32px;
  font-size: 13px;
  color: #726f68;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.footer-links a:hover {
  border-color: currentColor;
}

/* ---- submit page ---- */

.form-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.form-page h1 {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.form-page p.subtitle {
  text-align: center;
  font-size: 15px;
  color: #b0aea8;
  margin-bottom: 40px;
  line-height: 1.8;
}

.field {
  margin-bottom: 28px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--bone);
}

.field .hint {
  font-size: 12px;
  color: #8f8d87;
  margin-top: 6px;
}

textarea,
select {
  width: 100%;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 16px;
  color: var(--bone);
  background-color: #151515;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 14px 16px;
  resize: vertical;
}

textarea:focus,
select:focus {
  outline: none;
  border-color: var(--bone);
}

textarea {
  min-height: 140px;
  line-height: 1.8;
}

.color-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(244, 242, 237, 0.25);
  cursor: pointer;
  padding: 0;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.15s ease;
}

.color-option.selected {
  outline-color: var(--bone);
}

/* ---- message preview card ---- */

.message-card {
  position: relative;
  border-radius: 16px;
  padding: 26px 24px 18px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #1c1c1c;
  border: 1px dashed #3a3a3a;
  color: var(--bone);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  margin-bottom: 12px;
}

.message-card .card-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  opacity: 0.55;
  color: inherit;
  pointer-events: none;
}

.message-card.has-color {
  border: 1px solid transparent;
}

.message-card.has-color.is-black {
  border-color: rgba(244, 242, 237, 0.25);
}

.message-card .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: inherit;
}

.message-card .name-row .prefix {
  font-weight: 700;
  opacity: 0.9;
}

.message-card .name-input-field {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: inherit;
  padding: 0;
  flex: 1;
  min-width: 60px;
}

.message-card .name-input-field:focus { outline: none; }
.message-card .name-input-field::placeholder { color: inherit; opacity: 0.5; }

.message-card .message-textarea-field {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 19px;
  line-height: 1.8;
  color: inherit;
  flex: 1;
  resize: none;
  padding: 0;
  min-height: 120px;
}

.message-card .message-textarea-field:focus { outline: none; }
.message-card .message-textarea-field::placeholder { color: inherit; opacity: 0.45; }

.message-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: inherit;
  opacity: 0.6;
}

.name-hint {
  font-size: 12px;
  color: #8f8d87;
  line-height: 1.8;
  margin-bottom: 28px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.submit-row {
  text-align: center;
  margin-top: 8px;
}

.form-note {
  text-align: center;
  font-size: 13px;
  color: #8f8d87;
  margin-top: 20px;
  line-height: 1.8;
}

.confirmation-view {
  text-align: center;
  padding: 60px 0;
}

.confirmation-view h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
}

.confirmation-view p {
  font-size: 15px;
  line-height: 1.9;
  color: #b0aea8;
  margin-bottom: 32px;
}

@media (max-width: 600px) {
  header { padding: 16px 20px; }
  .logo { font-size: 16px; }
  nav a { font-size: 13px; margin-inline-start: 14px; }
  .hero h1 { font-size: 30px; }
  .hero { padding-top: 56px; }
}

@media (min-width: 700px) {
  .message-card {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- browse page ---- */

.browse-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.browse-page h1 {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.browse-page > p.subtitle {
  text-align: center;
  font-size: 15px;
  color: #b0aea8;
  margin-bottom: 32px;
  line-height: 1.8;
}

.browse-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 44px;
}

#search-input {
  width: 100%;
  max-width: 340px;
  font-family: inherit;
  font-size: 15px;
  color: var(--bone);
  background-color: #151515;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 12px 20px;
  text-align: center;
}

#search-input:focus { outline: none; border-color: var(--bone); }
#search-input::placeholder { color: #726f68; }

.filter-swatches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-pill {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(244, 242, 237, 0.3);
  color: var(--bone);
  cursor: pointer;
}

.filter-pill.selected {
  background: var(--bone);
  color: var(--black);
  border-color: var(--bone);
}

.filter-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(244, 242, 237, 0.25);
  cursor: pointer;
  padding: 0;
  outline: 2px solid transparent;
  outline-offset: 3px;
}

.filter-swatch.selected {
  outline-color: var(--bone);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

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

@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-tile {
  position: relative;
  border-radius: 16px;
  padding: 22px 20px 16px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-tile.is-black {
  border: 1px solid rgba(244, 242, 237, 0.25);
}

.gallery-tile .tile-date-top {
  font-size: 11px;
  opacity: 0.6;
  text-align: left;
}

.gallery-tile .tile-name {
  font-size: 14px;
}

.gallery-tile .tile-name .prefix {
  font-weight: 700;
}

.gallery-tile .tile-message {
  font-size: 15px;
  line-height: 1.75;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.gallery-tile .tile-message a.tile-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.gallery-tile .tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.gallery-tile .tile-hashtag {
  font-size: 11px;
  opacity: 0.55;
}

.gallery-tile .share-btn {
  background: transparent;
  border: none;
  padding: 2px;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: opacity 0.15s ease;
}

.gallery-tile .share-btn:hover {
  opacity: 1;
}

.empty-state {
  text-align: center;
  font-size: 14px;
  color: #8f8d87;
  margin-top: 48px;
}

.mock-data-note {
  text-align: center;
  font-size: 12px;
  color: #726f68;
  margin-top: 40px;
  line-height: 1.8;
}

/* ---- about / rules pages ---- */

.prose-page {
  max-width: 620px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.prose-page h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 28px;
}

.prose-page h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 36px 0 12px;
}

.prose-page p {
  font-size: 16px;
  line-height: 1.95;
  color: var(--bone);
  margin-bottom: 22px;
}

.prose-page p.muted {
  font-size: 14px;
  color: #b0aea8;
}

/* Reusable highlight — wrap any word/phrase in one of these classes to give
   it a colored background, marker-style. Kept as classes (not inline styles)
   so the words being highlighted can change freely during the content pass
   without needing to rebuild the styling each time. */
.prose-page .highlight {
  padding: 1px 8px;
  border-radius: 6px;
  color: #000000;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.prose-page .highlight-emerald { background-color: var(--emerald); }
.prose-page .highlight-amber { background-color: var(--amber); }
.prose-page .highlight-pacific { background-color: var(--pacific); }
.prose-page .highlight-blaze { background-color: var(--blaze); }

.prose-page .prose-cta {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.rules-list {
  display: flex;
  flex-direction: column;
  margin: 28px 0;
}

.rule-item {
  padding: 18px 0;
  border-bottom: 1px solid #2a2a2a;
}

.rule-item:last-child {
  border-bottom: none;
}

.rule-item h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-item h3 .rule-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rule-item p {
  font-size: 14px;
  line-height: 1.85;
  color: #b0aea8;
  margin: 0;
}

/* ---- admin page ---- */

.admin-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.admin-banner {
  background: #1c1c1c;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.8;
  color: #b0aea8;
  margin-bottom: 40px;
}

.admin-login {
  max-width: 320px;
  margin: 60px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-login h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-login input {
  font-family: inherit;
  font-size: 15px;
  color: var(--bone);
  background-color: #151515;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 12px 18px;
  text-align: center;
}

.admin-login input:focus {
  outline: none;
  border-color: var(--bone);
}

.login-hint {
  font-size: 12px;
  color: #726f68;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(244, 242, 237, 0.3);
  color: var(--bone);
  cursor: pointer;
}

.tab-btn.selected {
  background: var(--bone);
  color: var(--black);
  border-color: var(--bone);
}

.queue-list {
  display: flex;
  flex-direction: column;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #2a2a2a;
}

.queue-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(244, 242, 237, 0.2);
}

.queue-content {
  flex: 1;
  min-width: 0;
}

.queue-name {
  font-size: 13px;
  margin-bottom: 4px;
}

.queue-message {
  font-size: 14px;
  line-height: 1.7;
  color: #d8d4cb;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 6px;
}

.queue-date {
  font-size: 11px;
  color: #726f68;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.queue-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.queue-btn.approve {
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

.queue-btn.reject {
  border: 1px solid var(--brick-red);
  color: #e0574c;
}

.queue-btn.undo {
  border: 1px solid rgba(244, 242, 237, 0.3);
  color: var(--bone);
}

.queue-btn.download {
  border: 1px solid rgba(244, 242, 237, 0.3);
  color: var(--bone);
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

.status-badge.approved {
  background: rgba(64, 200, 135, 0.15);
  color: var(--emerald);
}

.status-badge.rejected {
  background: rgba(183, 18, 31, 0.15);
  color: #e0574c;
}

.empty-queue {
  text-align: center;
  font-size: 14px;
  color: #8f8d87;
  margin-top: 40px;
}

@media (max-width: 600px) {
  .queue-row { flex-wrap: wrap; }
  .queue-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
}
