body {
    margin: 0;
    font-family: system-ui, sans-serif;
    /*background-color: #ffffff;
    color: #333;*/
    display: grid;
    min-height: 100vh;

    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
  }

  body.dark-theme {
    --bg-primary: #121212;
    --text-primary: #f0f0f0;
  }

  body.light-theme {
    --bg-primary: #ffffff;
    --text-primary: #1a1a1a;
  }
  
  header {
    background: #EFEFEF;
    border-bottom: 1px solid #ddd;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .footer {
    bottom: 0;
    left: 0;
    text-align: center;
    padding: 1rem;
    background-color: #111;
    color: #aaa;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    z-index: 1000;
    margin-top: 30px;
  }

  .nav-container {
    display: flex;
    align-items: flex-start;
  }

  .nav-button {
    width: fit-content;
    min-width: 120px;
  }

  @media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-container {
    width: 100%;
    justify-content: flex-start;
  }
}

  .footer a {
    color: #aaa;
    text-decoration: none;
  }
  .footer a:hover {
    text-decoration: underline;
  }
  
  a.button {
    padding: 0.5rem 1rem;
    background: #0095f6;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
  }
  
  a.button:hover {
    background: #007fd0;
  }
  
  .container {
    max-width: 1350px;
    margin: 2rem auto;
    padding: 1rem;
  }
  
  .profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .profile-info img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 1em;
  }
  
  .profile-header h2 {
    margin: 0;
    font-size: 1.5rem;
  }
  
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 2rem;
  }
  
  .grid .photo {
    background-color: #ddd;
    aspect-ratio: 1;
    border-radius: 8px;
  }

  .profile-description {
    margin: 0.25rem 0 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
  }


.modal-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }

    

    .modal-image {
      max-width: 100%;
      max-height: 70vh;
      margin-bottom: 15px;
    }

    .image-info {
      color: #333;
      font-size: 14px;
    }

    .modal-close {
      margin-top: 10px;
      padding: 5px 10px;
      background: #eee;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    .photo {
      width: 150px;
      height: 150px;
      background-size: cover;
      background-position: center;
      margin: 10px;
      border-radius: 8px;
      cursor: pointer;
    }

    .grid {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
    }

    .comment-form textarea {
      width: 90%;
      border-radius: 5px;
      border: 1px solid #ccc;
      margin-bottom: 10px;
      resize: none;
      min-height: 50px;
      width: 100%;
    }

    .comment-form button {
      padding: 8px 16px;
      background-color: #afc7e0;
      color: rgb(0, 0, 0);
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    .comment-form button:hover {
      background-color: #204e80;
    }

    .comments-section {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 280px;
  box-sizing: border-box;
}



    .comment a {
      font-weight: bold;
      text-decoration: none;
      color: #333;
    }

 .comment p {
  margin-left: 10px;
  color: #1a1a1a;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: left;
  margin: 0;
}



.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 10px;
  flex-grow: 1;
}

.comment-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}

.comment {
  display: flex;
  margin-bottom: 10px;
  width: 100%;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

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

.comment-date {
  font-size: 0.8em;
  color: #888;
  margin-top: 5px;
}




.modal-image {
  max-width: 100%;
  max-height: 70vh;
  margin-bottom: 15px;
}

.image-info {
  color: #333;
  font-size: 14px;
}



 #drop-area {
      border: 2px dashed #999;
      border-radius: 8px;
      width: 100%;
      max-width: 600px;
      height: 100px;
      margin: 20px auto;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      background-color: #f5f5f5;
      color: #555;
      font-size: 36px;
      font-weight: bold;
      transition: background-color 0.3s;
      position: relative;
    }

    #drop-area:hover {
      background-color: #e0e0e0;
    }

    #drop-area.hover {
      border-color: #666;
      background: #f9f9f9;
    }

    #fileElem {
      display: none;
    }

    #upload-status {
      margin-top: 10px;
      font-size: 14px;
      color: #444;
      text-align: center;
    }

    .uploading span {
      display: none;
    }

    .uploading #upload-status {
      font-size: 16px;
    }

    .photo {
      width: 300px;
      height: 220px;
      background-size: cover;
      background-position: center;
      margin: 10px;
      border-radius: 8px;
      cursor: pointer;
    }

    .grid {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
    }

    .modal-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }

   .modal-content {
      background: #fff;
      border-radius: 10px;
      padding: 20px;
      text-align: center;
      max-width: 90%;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      box-sizing: border-box;
      width: fit-content;
    }

    .modal-image {
      max-width: 100%;
      max-height: 70vh;
      margin-bottom: 15px;
      display: block;
      width: auto;
      height: auto;
    }

    .image-info {
      color: #333;
      font-size: 14px;
    }

    .modal-close {
      margin-top: 10px;
      padding: 5px 10px;
      background: #eee;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }


  .profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .profile-edit {
    flex: 1;
  }

  .profile-edit input,
  .profile-edit textarea {
    width: 100%;
    padding: 0.4rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }

  #save-profile {
    padding: 0.4rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }

  #save-profile:hover {
    background: #0056b3;
  }

  .edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 5px;
    font-size: 16px;
  }

  .edit-btn:hover {
    opacity: 0.7;
  }

  #display-name-input,
  #description-input {
    width: 100%;
    margin-top: 5px;
  }

  .friends-section {
    margin-top: 20px;
  }

  .friends-section h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .friends-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

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

  .friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
  }

  .friend-name {
    margin-top: 5px;
    font-size: 1rem;
  }

  .logo {
    height: 80px;
    display: block;
  }

  .delete-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
  }

  .delete-btn:hover {
    background: #cc0000;
  }

  .myButton {
    box-shadow: 3px 4px 0px 0px #1564ad;
    background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);
    background-color:#79bbff;
    border-radius:5px;
    border:1px solid #337bc4;
    display:inline-block;
    cursor:pointer;
    color:#ffffff;
    font-family:Courier New;
    font-size:17px;
    font-weight:bold;
    padding:12px 53px;
    text-decoration:none;
    text-shadow:0px 1px 0px #528ecc;
    margin-left: 25px;
  }
  .myButton:hover {
    background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%);
    background-color:#378de5;
  }
  .myButton:active {
    position:relative;
    top:1px;
  }

  .oldButton {
    font-family: inherit;
    border: none;
    outline: 1px dotted rgb(37, 37, 37);
    outline-offset: -4px;
    cursor: pointer;
    background: hsl(0deg 0% 75%);
    box-shadow:
      inset -1px -1px #292929,
      inset 1px 1px #fff,
      inset -2px -2px rgb(158, 158, 158),
      inset 2px 2px #ffffff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 30px;
  }

  .oldButton:active {
    box-shadow:
      inset -1px -1px #fff,
      inset 1px 1px #292929,
      inset -2px -2px #ffffff,
      inset 2px 2px rgb(158, 158, 158);
  }

  .user-labels {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
  }

  .user-label {
    background-color: #5865F2;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  #cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 0.95rem;
    padding: 1rem;
    text-align: center;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease forwards;
  }

  #cookie-banner button {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 4px;
    background: #f1c40f;
    color: #000;
    font-weight: bold;
    cursor: pointer;
  }

  @keyframes slideUp {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
  }

  #load-more {
    display: block;
    margin: 20px auto;
    border: none;
    transition: background-color 0.3s;
  }


/* Author overlay info */
.photo {
  position: relative;
  overflow: hidden;
}

.photo-author-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px;
  text-align: center;
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.photo:hover .photo-author-overlay {
  transform: translateY(0);
}



/* Upload image menu */
#drop-area {
  position: relative;
}

#game-selector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 100;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#game-search {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
  font-size: 14px;
}

.game-list {
  flex-grow: 1;
  overflow-y: auto;
  text-align: left;
}

.game-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-item:hover {
  background: #f5f5f5;
  color: #000;
}

/* Upload form */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.game-modal-content {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  width: 320px;
  color: #fff;
  border: 1px solid #444;
}

.search-container {
  position: relative;
  margin: 15px 0;
}

#game-search {
  width: 100%;
  padding: 10px;
  background: #333;
  border: 1px solid #555;
  color: #fff;
  box-sizing: border-box;
}

.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: #333;
  border: 1px solid #555;
  border-top: none;
  z-index: 10000;
  display: none;
}

.dropdown-item {
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #444;
}

.dropdown-item:hover {
  background: #444;
  color: #fff;
}

/* Subscribe button + page title */
.page-title-container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 5%;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.page-title-container h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
}

.like-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Feed */
.feed-post {
    width: 100%;
    background: var(--card-bg, #1a1a1a);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.feed-post img {
    width: 100%;
    display: block;
    cursor: pointer;
}

.feed-post-info {
    padding: 15px;
}

.feed-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feed-post-author {
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}

/* Game description */
.game-description {
  max-width: 1100px;
  margin: 0 auto 24px auto;
  padding: 18px 22px;

  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;

  backdrop-filter: blur(10px);

  color: rgba(255,255,255,0.82);

  line-height: 1.7;
  font-size: 0.95rem;
}

.light-theme .game-description {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.78);
}

.page-title-container {
  max-width: 1100px;
  margin: 24px auto 18px auto;

  display: flex;
  align-items: center;
  gap: 20px;

  padding: 20px;

  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;

  backdrop-filter: blur(10px);
}

.game-header-image {
  width: 320px;
  height: auto;

  border-radius: 12px;

  object-fit: cover;

  box-shadow:
    0 8px 30px rgba(0,0,0,0.35);
}

.game-header-content {
  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 14px;

  flex: 1;
}

.game-header-content h1 {
  margin: 0;

  font-size: 2.2rem;
  font-weight: 800;

  color: white;
}

.game-header-buttons {
  display: flex;
  gap: 10px;
}

.light-theme .page-title-container {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
}

.light-theme .game-header-content h1 {
  color: #111;
}

@media (max-width: 768px) {
  .page-title-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-header-image {
    width: 100%;
  }

  .game-header-content h1 {
    font-size: 1.8rem;
  }
}