:root {
  --bg: #0c0f12;
  --surface: #151b22;
  --surface2: #1f2835;
  --text: #eef2f7;
  --muted: #8b98a8;
  --accent: #c94c4c;
  --accent-hover: #e05a5a;
  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.25);
  --blue-deep: #2a4a6e;
  --ok: #3d9a6e;
  --radius: 14px;
  --font: "DM Sans", "Noto Sans Georgian", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  position: relative;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(201, 76, 76, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(42, 74, 110, 0.35), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(212, 168, 83, 0.08), transparent 50%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--surface2);
  background: rgba(12, 15, 18, 0.88);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.brand-block {
  min-width: 0;
}

.logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.logo-sub {
  font-family: "Noto Sans Georgian", serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
  opacity: 0.95;
}

.logo:hover {
  color: #fff;
}

.tagline {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 36ch;
}

.auth-slot-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.profile-avatar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.profile-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface2);
  background: var(--bg);
  flex-shrink: 0;
}

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

.profile-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-avatar-upload {
  cursor: pointer;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.stat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--surface2);
}

.profile-bio-label {
  display: block;
  margin-top: 0.65rem;
}

.profile-share-wrap {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface2);
}

.profile-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.profile-share-row .dev-link-input {
  flex: 1 1 180px;
  min-width: 0;
}

.user-public-card {
  max-width: min(520px, 96vw);
}

.user-public-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0.5rem 0 0.75rem;
}

.user-public-face {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface2);
  flex-shrink: 0;
}

.user-public-face-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

.user-public-uname {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.user-public-hint {
  margin: 0.5rem 0 0.35rem;
}

.user-contrib-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(48vh, 380px);
  overflow-y: auto;
  margin-top: 0.5rem;
}

.user-contrib-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.user-contrib-item .user-contrib-row {
  flex: 1 1 auto;
  min-width: 0;
}

.user-contrib-link-copy {
  flex: 0 0 auto;
  align-self: center;
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.user-contrib-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--surface2);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-contrib-row:hover {
  border-color: rgba(212, 168, 83, 0.35);
  background: var(--surface2);
}

.user-contrib-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.user-contrib-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.user-contrib-lang {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.user-contrib-text {
  font-size: 0.85rem;
  line-height: 1.35;
  word-break: break-word;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.85rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1fr 220px;
    align-items: center;
    padding-top: 3rem;
    padding-bottom: 3.5rem;
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 42ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-stats strong {
  display: block;
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 700;
}

.stat-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-deco {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 880px) {
  .hero-deco {
    height: 260px;
  }
}

.deco-ring {
  position: absolute;
  width: min(200px, 50vw);
  height: min(200px, 50vw);
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.deco-dots {
  position: absolute;
  width: 120px;
  height: 120px;
  background-image: radial-gradient(var(--muted) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.25;
  border-radius: var(--radius);
}

.main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: var(--surface2);
  border: 1px solid rgba(201, 76, 76, 0.35);
}

.banner.ok {
  border-color: rgba(61, 154, 110, 0.45);
}

.banner p {
  margin: 0;
  font-size: 0.95rem;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  flex-shrink: 0;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: 1fr min(300px, 32%);
    gap: 2rem 1.75rem;
    align-items: start;
  }

  .layout-aside {
    position: sticky;
    top: 5.5rem;
  }
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2,
#gallery-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.section-sub {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.community {
  margin-bottom: 0.5rem;
}

.leaderboard-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-scroll::-webkit-scrollbar {
  height: 6px;
}

.leaderboard-scroll::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 3px;
}

.lb-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 140px;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lb-card:hover {
  border-color: rgba(212, 168, 83, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.lb-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.lb-face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.4rem;
  border: 2px solid var(--surface2);
  background: var(--bg);
}

.lb-face-fallback {
  line-height: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.lb-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.lb-points {
  font-size: 0.8rem;
  color: var(--muted);
}

.lb-lang {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--surface2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--muted);
}

.chip.active {
  background: var(--gold-dim);
  border-color: rgba(212, 168, 83, 0.45);
  color: var(--gold);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  }
}

.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface2);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 168, 83, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.card[hidden] {
  display: none !important;
}

.card-visual {
  position: relative;
}

.card-avatars {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  pointer-events: auto;
}

.card-avatar-hit {
  margin-left: -10px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  flex-shrink: 0;
}

.card-avatar-hit:first-child {
  margin-left: 0;
}

.card-avatar-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  background: var(--surface2);
  display: block;
  pointer-events: none;
}

.card-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 0.7rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
}

.pill {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.badge-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.card-meta {
  padding: 0.55rem 0.7rem 0.65rem;
  margin: 0;
}

.lang-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.lang-dot {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
}

.lang-dot.on {
  background: rgba(201, 76, 76, 0.2);
  color: #f0a0a0;
}

.card-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--surface2);
  border-radius: var(--radius);
  max-width: 420px;
  margin: 0 auto;
}

.empty-state h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.empty-state p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--surface2), var(--blue-deep));
  opacity: 0.85;
  position: relative;
}

.empty-icon::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed var(--muted);
  border-radius: 8px;
  opacity: 0.5;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.panel-tight .panel-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 600;
}

/* —— Gönderi oluştur (önizleme + açıklama) —— */
.upload-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
}

.upload-composer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.upload-preview-box {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface2);
  background: var(--bg);
  aspect-ratio: 1;
  max-height: 280px;
}

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

.upload-file-label {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 0;
}

.upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-file-btn {
  display: block;
  text-align: center;
  pointer-events: none;
}

.upload-caption-label {
  margin: 0;
  gap: 0.4rem;
}

.upload-caption-heading {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upload-caption-input {
  resize: vertical;
  min-height: 4.5rem;
}

.upload-lang-select {
  width: 100%;
  max-width: 100%;
}

.upload-share-btn {
  margin-top: 0.15rem;
}

.tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface2);
  color: var(--text);
}

.form-tab {
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

.form-tab.active {
  display: flex;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.stretch {
  width: 100%;
}

.btn-lg {
  padding: 0.7rem 1.35rem;
  font-size: 0.98rem;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--surface2);
}

.btn.outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn.secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--surface2);
}

.btn.secondary:hover {
  border-color: var(--muted);
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.forgot-line {
  margin: 0.5rem 0 0;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: #e8c46e;
}

.forgot-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface2);
}

.subhead {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.dev-link {
  margin-top: 0.75rem;
}

.dev-link-input {
  width: 100%;
  font-size: 0.75rem;
}

.forgot-status {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
  background: var(--surface2);
  border: 1px solid var(--surface2);
  color: var(--text);
}

.forgot-status.ok {
  border-color: rgba(61, 154, 110, 0.45);
  background: rgba(61, 154, 110, 0.12);
}

.forgot-status.err {
  border-color: rgba(201, 76, 76, 0.45);
  background: rgba(201, 76, 76, 0.1);
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--surface2);
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow-y: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: min(960px, 98vw);
  max-height: calc(100vh - 1rem);
  overflow-y: auto;
  margin: 0.35rem auto;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  z-index: 1;
}

.modal-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-image-stage {
  margin: 0.75rem 0;
}

.modal-image-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--surface2);
  min-height: min(42vh, 420px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.modal-image-wrap img {
  width: 100%;
  height: auto;
  max-height: min(68vh, 760px);
  object-fit: contain;
  background: var(--bg);
  display: block;
}

.modal-crop-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 2;
  background: transparent;
}

.modal-crop-marquee,
.modal-entry-highlight {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
}

.modal-entry-highlight {
  border-color: var(--text);
  background: rgba(100, 180, 255, 0.2);
}

.modal-crop-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.modal-crop-bar .link-btn {
  font-size: 0.85rem;
}

.entry-crop-badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.entry-item-main .entry-crop-badge {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.modal-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  max-height: min(34vh, 320px);
  overflow-y: auto;
}

.entry-item {
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--surface2);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.entry-item.is-highlighting {
  border-color: rgba(120, 170, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(120, 170, 255, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.14);
}

.entry-item-focused {
  box-shadow:
    0 0 0 2px rgba(212, 168, 83, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  transition: box-shadow 0.2s ease;
}

.entry-item-head {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.entry-item-head .entry-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-author-hit {
  flex-shrink: 0;
  margin-top: 0.1rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}

.entry-author-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.entry-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  background: var(--surface2);
  pointer-events: none;
}

.entry-author-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

.entry-item-main {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.15rem 0;
}

.entry-item-main:hover {
  background: var(--surface2);
}

.entry-item .lang {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.entry-item .entry-text {
  margin: 0.15rem 0 0;
}

.btn-entry-comments {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.2rem 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.btn-entry-comments:hover,
.btn-entry-comments.is-open {
  color: var(--accent);
}

.entry-comments-panel {
  margin-top: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface2);
}

.entry-comments-panel[hidden] {
  display: none !important;
}

.entry-comments-panel .comments-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.comments-list-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.comment-line {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.82rem;
  line-height: 1.35;
}

.comment-author-hit {
  flex-shrink: 0;
  margin-top: 0.05rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}

.comment-author-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  background: var(--surface2);
  pointer-events: none;
}

.comment-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
}

.comment-body {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-line .comment-user {
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.35rem;
}

.comment-form-inline {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.comment-form-inline .comment-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: inherit;
  font: inherit;
  resize: vertical;
  min-height: 2.5rem;
}

.guest-comments-note {
  margin: 0.35rem 0 0;
}

.entry-form {
  border-top: 1px solid var(--surface2);
  padding-top: 1rem;
}

.entry-form h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.entry-form.guest-only {
  opacity: 0.55;
  pointer-events: none;
}

.entry-form .note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
