* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
  background: var(--dw-bg);
  background-image: var(--dw-bg-gradient);
  background-attachment: fixed;
  color: var(--dw-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(48px + var(--safe-bottom));
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.moments-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(11, 15, 25, 0.82);
  border-bottom: 1px solid var(--dw-border);
  padding: calc(12px + var(--safe-top)) 16px 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--dw-radius-sm);
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--dw-primary-glow);
}

.header-logo svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.header-titles h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-titles .subtitle {
  font-size: 11px;
  color: var(--dw-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--dw-border);
  background: var(--dw-surface);
  color: var(--dw-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--dw-surface-hover);
}

.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Notice / Hero Banner
   ========================================================================== */
.hero-status-strip {
  margin: 12px 14px 4px 14px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--dw-radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.hero-status-strip .info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e0f2fe;
}

.hero-status-strip .clock-badge {
  font-weight: 600;
  color: var(--dw-primary);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: var(--dw-radius-full);
}

/* ==========================================================================
   Feed Timeline Stream
   ========================================================================== */
.feed-container {
  padding: 8px 14px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--dw-surface-card);
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-lg);
  box-shadow: var(--dw-shadow-md);
  padding: 16px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:active {
  border-color: var(--dw-border-hover);
}

/* Author Row */
.author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(56, 189, 248, 0.35);
  background: #1e293b;
  cursor: pointer;
  flex-shrink: 0;
}

.author-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.post-location {
  font-size: 11px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-time {
  font-size: 11px;
  color: var(--dw-text-dim);
}

/* Post Content */
.post-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fbcfe8;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 4px 10px;
  border-radius: var(--dw-radius-sm);
  margin-bottom: 8px;
}

.post-text {
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 12px;
  word-break: break-word;
}

/* Media Grid */
.media-container {
  border-radius: var(--dw-radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.media-single {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--dw-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: block;
  transition: transform 0.25s ease;
}

.media-single:active {
  transform: scale(0.985);
}

.media-grid {
  display: grid;
  gap: 6px;
}

.media-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.media-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-item-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--dw-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

/* Actions Row */
.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--dw-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--dw-radius-full);
  transition: all 0.2s ease;
}

.action-btn:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.95);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.liked {
  color: var(--dw-accent);
}

.action-btn.liked svg {
  transform: scale(1.2);
  fill: var(--dw-accent);
}

/* Comments Section */
.comments-section {
  margin-top: 12px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.55);
  border-radius: var(--dw-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #334155;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  color: #93c5fd;
  margin-right: 4px;
}

.comment-text {
  color: #cbd5e1;
}

/* Comment Input Bar */
.comment-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.comment-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--dw-radius-full);
  padding: 8px 14px;
  font-size: 13px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.comment-input:focus {
  border-color: var(--dw-primary);
}

.send-btn {
  background: var(--dw-primary);
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--dw-radius-full);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Lightbox (Full-screen Photo View)
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--dw-radius-sm);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.lightbox-modal.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Skeletons & Empty States
   ========================================================================== */
.skeleton-card {
  background: var(--dw-surface);
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--dw-radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--dw-text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  fill: var(--dw-text-dim);
}
