*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Base styles */
a {
  color: inherit;
  text-decoration: none;
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir,
    "segoe ui", "helvetica neue", helvetica, Cantarell, Ubuntu, roboto,
    noto, arial, sans-serif;
  color: #1c1e21;
  background-color: #fff;
  opacity: 0;
  transition: background-color 0.3s, color 0.3s, opacity 0.1s;
}

body::-webkit-scrollbar {
  display: none;
}

/* Dark mode */
.dark body {
  color: #f3f4f6;
  background: #000000;
}

/* Layout */
.container {
  max-width: 935px;
  margin: 0 auto;
  padding: 30px 20px;
  width: 100%;
  position: relative;
}

.customize-banner {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  transform: rotate(5deg);
  transition: transform 0.2s;
  cursor: pointer;
  opacity: 0.8;
  background: transparent;
}

.customize-banner:hover {
  transform: rotate(5deg) scale(1.05);
  opacity: 1;
  text-decoration: underline;
}

.dark .customize-banner {
  color: #3b82f6;
  background: transparent;
}

.profile-header {
  display: flex;
}

.profile-picture {
  width: 66px;
  height: 66px;
  border-radius: 50%;
}

.profile-info {
  margin-left: 1em;
  text-align: left;
}

.profile-username {
  font-size: 28px;
  font-weight: 300;
  line-height: 32px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 1px;
}

.profile-meta {
  color: #8e8e8e;
  font-size: 14px;
}

.profile-stats {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
}

.profile-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-stat-text {
  cursor: default;
}

.profile-stat-text[data-clickable="true"] {
  cursor: pointer;
}

.profile-stat-text[data-clickable="true"]:hover {
  text-decoration: underline; 
}

.profile-stat-text:hover {
  text-decoration: none;
}

.avatar-stack {
  display: flex;
  align-items: center;
  margin-left: auto;
  cursor: pointer;
  transition: opacity 0.2s;
}

.avatar-stack:hover {
  opacity: 0.8;
}

.avatar-stack img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -12px;
  pointer-events: none;
}

.dark .avatar-stack img {
  border-color: #000000;
}

.content {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  max-width: 935px;
  width: 100%;
  margin: 0 auto;
}

.content.guestbook {
  display: block;
}

.content.small {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .content {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.feed-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  overflow: hidden;
  width: 100%;
  border: 1px solid #d1d5db;
  transition: background-color 0.2s, border-color 0.2s;
}

.feed-item:hover {
  background-color: #e5e7eb;
  border-color: #6b7280;
}

.feed-image {
  width: 100%;
}

.feed-image img {
  display: block;
  width: 100%;
  height: auto;
}

.feed-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.5rem;
}

.feed-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.feed-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 0;
}

.dark .feed-description {
  color: #9ca3af;
}

.feed-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: auto;
}

.feed-stat {
  display: flex;
  align-items: center;
}

.stat-icon {
  width: 12px;
  height: 12px;
}

.dark .feed-item {
  background-color: #1e1e1e;
  border-color: #333333;
}

.dark .feed-title {
  color: #f3f4f6;
}

.dark .feed-avatar {
  color: #f3f4f6;
}

.feed-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.feed-avatar img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.feed-avatar-name {
  font-size: 14px;
  color: #6b7280;
}

.dark .feed-avatar-name {
  color: #9ca3af;
}

.comment-section {
  margin: 20px auto;
  display: none;
}

.comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.comment {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.dark .comment {
  background: #1e1e1e;
  border-color: #333;
}

.comment:hover {
  background: #e5e7eb;
}

.dark .comment:hover {
  background: #262626;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

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

.username {
  font-weight: 600;
  margin-bottom: 2px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.username:hover {
  text-decoration: underline;
}

.message {
  color: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.new-comment {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 8px;
}

.dark .new-comment {
  background: #1e1e1e;
  border-color: #333;
}

.comment-input-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.comment-input-wrapper {
  position: relative;
  flex: 1;
}

.comment-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: none;
  height: 80px;
  background: white;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s;
}

.dark .comment-input {
  background: #262626;
  border-color: #404040;
  color: #f3f4f6;
}

.comment-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.dark .comment-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.character-count {
  position: absolute;
  bottom: -20px;
  right: 0;
  font-size: 12px;
  color: #6b7280;
}

.character-count.warning {
  color: #ef4444;
}

.dark .character-count {
  color: #9ca3af;
}

.dark .character-count.warning {
  color: #f87171;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.submit-btn {
  padding: 8px 16px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background: #1d4ed8;
}

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.reminder-text {
  color: #6b7280;
  font-size: 12px;
  margin-top: 8px;
  margin-right: 12px;
  text-align: right;
}

.dark .submit-btn:disabled {
  background: #4b5563;
}

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

.comment-metadata {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timestamp {
  color: #6b7280;
  font-size: 12px;
}

.heart-button {
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.heart-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.heart-button.liked {
  color: #ef4444;
  border-color: #ef4444;
}

.dark .heart-button {
  border-color: #404040;
}

.dark .heart-button:hover {
  background: #262626;
  border-color: #6b7280;
}

.dark .timestamp {
  color: #9ca3af;
}

.comment-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.delete-button {
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #ef4444;
  border-radius: 4px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-button:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

.dark .delete-button:hover {
  background: rgba(239, 68, 68, 0.1);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.dark .modal {
  background: #1e1e1e;
  border: 1px solid #333;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: inherit;
  padding: 4px;
}

.modal-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.customize-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customize-option {
  padding: 16px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.dark .customize-option {
  background: #262626;
  border-color: #404040;
}

.customize-option:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateX(4px);
}

.dark .customize-option:hover {
  background: #1e1e1e;
  border-color: #6b7280;
}

.customize-modal {
  width: 90%;
  max-width: 600px;
}

.dark .customize-modal {
  background: #1e1e1e !important;
  border: 1px solid #404040 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

.dark .modal-title {
  color: #f3f4f6;
}

.dark .modal-close {
  color: #f3f4f6;
}

.dark .customize-modal a {
  color: #3b82f6;
}

.dark .customize-modal .customize-options > div {
  color: #f3f4f6;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.page-button {
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.page-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.page-button.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.dark .page-button {
  border-color: #404040;
  color: #9ca3af;
}

.dark .page-button:hover {
  background: #262626;
  border-color: #6b7280;
}

.dark .page-button.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.tab-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #d1d5db;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 500;
}

.tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.dark .tab-container {
  border-bottom-color: #404040;
}

.dark .tab {
  color: #9ca3af;
}

.dark .tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

@media (max-width: 640px) {
  .customize-banner {
    padding: 4px 8px;
    font-size: 14px;
    top: 10px;
    right: 10px;
    transform: rotate(3deg);
  }

  .customize-banner:hover {
    transform: rotate(3deg) scale(1.05);
  }
}

.username {
  font-weight: 600;
  margin-bottom: 2px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.username:hover {
  text-decoration: underline;
}

.comment > a {
  display: block;
  text-decoration: none;
}

.comment > a:hover {
  opacity: 0.8;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.letter-gif {
  height: 20px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin: -4px 1px;
}

.profile-username .letter-gif {
  height: 32px;
}

.tab .letter-gif {
  height: 16px;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5865F2;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 14px;
}

.discord-link:hover {
  background-color: rgba(88, 101, 242, 0.1);
}

.dark .discord-link {
  color: #7289DA;
}

.dark .discord-link:hover {
  background-color: rgba(114, 137, 218, 0.1);
}

.discord-logo {
  width: 16px;
  height: 16px;
}

.soundcloud-footer {
  margin-top: 40px;
  padding: 0 20px;
  max-width: 935px;
  margin-left: auto;
  margin-right: auto;
}

.soundcloud-caption {
  font-size: 10px;
  color: #cccccc;
  line-break: anywhere;
  word-break: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;
  font-weight: 100;
  margin-top: 4px;
}

.soundcloud-caption a {
  color: #cccccc;
  text-decoration: none;
}

.soundcloud-caption a:hover {
  color: #ffffff;
}

.achievement-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  grid-column: 1 / -1;
  background: #000;
  border-radius: 8px;
  padding: 20px;
}

.achievement {
  display: flex;
  gap: 10px;
  align-items: center;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement.unlocked {
  opacity: 1;
  transform: scale(1);
}

.achievement-gif {
  height: 48px;
  width: auto;
}

.hidden-flag {
  position: fixed;
  width: 20px;
  height: 20px;
  opacity: 0.1;
  cursor: pointer;
  z-index: 100;
  transition: opacity 0.2s;
}

.hidden-flag:hover {
  opacity: 0.3;
}