:root {
  --navy: #0b2545;
  --navy-light: #123869;
  --card-bg: #142f56;
  --yellow: #ffc72c;
  --text: #f2f4f7;
  --text-dim: #b9c6da;
  --danger: #d9534f;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px;
}

a { color: var(--yellow); }

.header {
  background: var(--navy-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--yellow);
  position: sticky;
  top: 0;
}

.header h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--yellow);
}

.header-side {
  flex: 1 0 0;
  display: flex;
}

.header-side-right {
  justify-content: flex-end;
}

.page-footer {
  text-align: center;
  padding: 24px 0 8px;
}

.back-link {
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.container {
  padding: 16px;
  max-width: 680px;
  margin: 0 auto;
  flex: 1 0 auto;
  width: 100%;
}

.post-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: block;
  text-decoration: none;
  color: var(--text);
  border-left: 4px solid var(--yellow);
  transition: transform 0.1s ease;
}

.post-card:active { transform: scale(0.99); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #24466f;
  flex-shrink: 0;
}

.post-meta-text {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.post-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 50px 20px;
}

.article-title {
  font-size: 1.35rem;
  margin: 10px 0 16px;
  color: var(--yellow);
}

.article-body {
  line-height: 1.65;
  margin-bottom: 18px;
  white-space: pre-line;
}

.article-images img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
  display: block;
}

.pin-form, .admin-form {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.admin-form h3 { margin-top: 0; }

.admin-form label, .pin-form label {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.admin-form input, .admin-form textarea, .pin-form input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #24466f;
  background: #0e2038;
  color: #fff;
  margin-top: 4px;
  font-size: 1rem;
}

.admin-form textarea { min-height: 130px; resize: vertical; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0e2038;
  border: 1px solid #24466f;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1;
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--yellow);
}

.radio-option .avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}

.radio-option span {
  line-height: 1;
}

.btn {
  display: inline-block;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  text-decoration: none;
  margin-top: 16px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-danger { background: var(--danger); color: #fff; margin-left: 8px; }

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.admin-list-item span:first-child {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-list-actions { white-space: nowrap; }
.admin-list-actions a { margin-left: 10px; font-size: 0.85rem; text-decoration: none; }

.error-text { color: #ff9a96; font-size: 0.85rem; }

.flash-message {
  background: #143322;
  border: 2px solid #3ddc84;
  color: #baffce;
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: flash-pulse 0.7s ease-out 3;
}

.flash-message::before {
  content: "✓ ";
}

@keyframes flash-pulse {
  0%, 100% {
    background: #143322;
    box-shadow: none;
    transform: scale(1);
  }
  30% {
    background: #3ddc84;
    color: #0b2545;
    box-shadow: 0 0 28px 6px rgba(61, 220, 132, 0.65);
    transform: scale(1.035);
  }
}

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

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.back-fab {
  position: fixed;
  left: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px 11px 14px;
  background: #10233F;
  color: #FFC72C;
  border: 2px solid #FFC72C;
  border-radius: 999px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}

.back-fab:active { transform: translateY(1px); }
.back-fab.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .back-fab:active { transform: none; }
}
