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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #1C2526;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
  color: #FFF8E1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  
  /* remove this to let background scale naturally */
  /* overflow: hidden; */
}

/* Mobile first — exactly your original */
.container {
  width: 100%;
  max-width: 375px;
  height: 100vh;
  background: #1C2526;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease-out;
}

/* Desktop: beautiful centered phone card */
@media (min-width: 640px) {
  body {
    background: #0d1214;
  }
  .container {
    max-width: 400px;
    height: 96vh;
    margin: 2vh auto;
    border-radius: 28px;
    box-shadow: 
      0 25px 70px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(255,255,255,0.06);
  }
  .navbar-top,
  .navbar-bottom {
    border-radius: 28px 28px 0 0;
  }
  .navbar-bottom {
    border-radius: 0 0 28px 28px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 90%;   /* fills 90% of screen width */
    height: 90vh;     /* fills 90% of screen height */
    border-radius: 16px;
    margin: 5vh auto; /* center vertically and horizontally */
  }
}

.screen {
  display: none;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  background: transparent;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out;
}

.active {
  display: flex;
  opacity: 1;
}

#authScreen {
  padding: 24px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  min-height: 100vh;
  overflow: hidden;
}

#authScreen h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #FFF8E1;
  margin-bottom: 24px;
  transition: opacity 0.3s ease;
}

#authScreen input {
  background: #2A2F31;
  color: #FFF8E1;
  border: 1px solid #3C4547;
  padding: 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s ease-out;
}

#authScreen input:focus {
  border-color: #FFEC58;
  box-shadow: #FFE300;
  transform: scale(1.02);
}

#authScreen button {
  background: #E1F5FF;
  color: #1C2526;
  font-weight: 500;
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
  margin: 8px 0;
  transition: all 0.2s ease-out;
}

#authScreen button:hover {
  background: #6409FF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

#authScreen button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
}

h2, h3 {
  margin: 16px 0;
  font-size: 1.5rem;
  font-weight: 500;
  color: #FFF8E1;
  text-align: center;
  transition: opacity 0.3s ease;
}

h3 {
  font-size: 1.2rem;
}

input, button, select {
  margin: 6px 0;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 90%;
  transition: all 0.2s ease-out;
  touch-action: manipulation;
}

select {
  padding: 6px;
  width: 100px;
  font-size: 0.85rem;
  background: #2A2F31;
  color: #FFF8E1;
  border: 1px solid #3C4547;
  cursor: pointer;
  appearance: none;
}

input {
  background: #2A2F31;
  color: #FFF8E1;
  border: 1px solid #3C4547;
}

input:focus, select:focus {
  outline: none;
  border-color: #FFF8E1;
  box-shadow: 0 0 8px rgba(255, 248, 225, 0.3);
  transform: scale(1.02);
}

button {
  background: #FFF8E1;
  color: #1C2526;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-out;
}

button:hover {
  background: #E0D8B0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 248, 225, 0.3);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 248, 225, 0.2);
}

button:disabled {
  background: #3C4547;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.navbar-top {
  height: 48px;
  width: 100%;
  background: #2A2F31;
  color: #FFF8E1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: background 0.2s ease-out;
}

.navbar-bottom {
  height: 48px;
  background: #2A2F31;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0;
  width: 100%;

  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: background 0.2s ease-out;
}

.navbar-bottom button {
  background: transparent;
  color: #FFF8E1;
  flex: 1;
  margin: 0 4px;
  padding: 8px;
  font-size: 0.85rem;
  border-radius: 8px;
  transition: all 0.2s ease-out;
}

.navbar-bottom button.post-btn {
  color: #FFF8E1;
  font-weight: 500;
  transform: scale(1.05);
}

.navbar-bottom button:hover {
  background: #FFF8E1;
  color: #1C2526;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 248, 225, 0.3);
}

.navbar-bottom button.post-btn:hover {
  background: #E0D8B0;
}

.feed, .users {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  padding: 72px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  min-height: calc(100vh - 96px);
  scroll-behavior: smooth;
}

.settings {
  flex: 1;
  width: 100%;
  padding: 72px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  min-height: calc(100vh - 96px);
}

.sort-controls, .search-controls {
  width: 100%;
  margin-bottom: 1px;
  display: flex;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.search-controls input {
  background: #2A2F31;
  color: #FFF8E1;
  border: 1px solid #3C4547;
  padding: 10px;
  font-size: 0.9rem;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s ease-out;
}

.search-controls input:focus {
  border-color: #00BCD4;
  box-shadow: 0 0 8px rgba(0, 188, 212, 0.3);
  transform: scale(1.02);
}

.post, .user {
  background: #2A2F31;
  margin: 32px 0;
  padding: 36px;
  border-radius: 12px;
  width: 90%;
  transition: all 0.3s ease-out;
  cursor: pointer;
  touch-action: manipulation;
}

.post:hover, .user:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  justify-content: space-between;
}

.user > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 0 !important;
  margin-bottom: 16px;
}

.user > div:first-child > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-bottom: 12px;
}

.user > div:first-child > div:first-child > div:not(.pfp) {
  font-weight: 600;
  color: #00BCD4;
  font-size: 1rem;
  text-align: center;
}

.user > div:first-child > div:nth-child(2) {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.pfp {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  border: 1px solid #FFF8E1;
  transition: transform 0.2s ease-out;
}

.pfp:hover {
  transform: scale(1.1);
}

.post-meta, .user-meta {
  flex: 1;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.post-user, .user-name {
  font-weight: 600;
  color: #00BCD4;
}

.post-time, .user-time {
  font-size: 0.65rem;
  color: #FFF8E1;
}

.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: #FFF8E1;
}

.user-actions button {
  background: #3C4547;
  color: #FFF8E1;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  border: none;
  cursor: pointer;
  min-width: 60px;
  justify-content: center;
  transition: all 0.2s ease-out;
}

.user-actions button:hover {
  background: #4A5557;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-actions button:first-child {
  color: #4CAF50;
}

.user-actions button:nth-child(2) {
  color: #D64538;
}

.post-content {
  margin-bottom: 12px;
  text-align: left;
  transition: opacity 0.3s ease;
}

.post-actions, .comments {
  display: none;
  margin-top: 12px;
}

.post.expanded .post-actions, .post.expanded .comments {
  display: flex;
  animation: slideIn 0.3s ease-out;
}

.post-actions {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  justify-content: center;
  flex-wrap: nowrap;
}

.post-actions button {
  background: none;
  color: #FFF8E1;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease-out;
}

.post-actions button:hover {
  background: #3C4547;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.delete-btn {
  background: #D64538 !important;
  color: #FFF8E1 !important;
  padding: 6px !important;
  font-size: 0.75rem !important;
  width: auto !important;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.2s ease-out;
}

.delete-btn:hover {
  background: #B8372D !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.delete-btn::before {
  content: "🗑️";
  margin-right: 4px;
}

.report-btn {
  background: #8E44AD !important;
  color: #FFF8E1 !important;
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  width: auto !important;
  min-width: 80px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.2s ease-out;
}

.report-btn:hover {
  background: #7D3C98 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comments {
  padding-left: 16px;
  width: 100%;
  flex-direction: column;
}

.comment {
  background: #3A4345;
  margin: 8px 0;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-out;
}

.comment:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comment-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comment-user {
  font-weight: 600;
  color: #00BCD4;
  text-align: center;
}

.comment-time {
  font-size: 0.7rem;
  color: #A8B0B2;
  text-align: center;
}

.comment-pfp {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  border: 1px solid #FFF8E1;
  transition: transform 0.2s ease-out;
}

.comment-pfp:hover {
  transform: scale(1.1);
}

.comment-body {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
}

.popup-content {
  background: #2A2F31;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  animation: popupScale 0.3s ease-out forwards;
}

.error-popup {
  background: #D64538;
  box-shadow: 0 8px 24px rgba(214, 69, 56, 0.4);
}

.terms-popup {
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.terms-content {
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #FFF8E1;
  text-align: left;
}

.terms-content hr {
  border: 0;
  border-top: 1px solid #3C4547;
  margin: 12px 0;
}

.terms-content p {
  margin-bottom: 12px;
}

.terms-content strong {
  font-weight: 600;
  color: black;
}

.terms-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  font-size: 0.9rem;
  color: #FFF8E1;
}

#termsCheckbox {
  margin-right: 6px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #00BCD4;
}

.no-data {
  text-align: center;
  padding: 16px;
  color: #A8B0B2;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupScale {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}