/* Comments — game_tgn_0051 Box Seat */

.g51-comments-section {
  margin-top: 4px;
  padding: 18px 18px 20px;
  background: #f7f3ea;
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(26, 31, 28, 0.07);
  position: relative;
}

.g51-comments-section::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #e85d4c, transparent 85%);
  pointer-events: none;
}

.g51-comments-section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #1a1f1c;
  margin: 0 0 16px;
}

.g51-comments-section > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(26, 31, 28, 0.14);
  min-width: 24px;
}

/* ——— Login prompt ——— */
.g51-comment-login-prompt {
  padding: 22px 18px;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  text-align: center;
  margin-bottom: 18px;
}

.g51-comment-login-prompt[hidden] {
  display: none !important;
}

.g51-comment-login-prompt__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1f1c;
}

.g51-comment-login-prompt__text {
  margin: 0 0 14px;
  font-size: 0.875rem;
  color: #5c6b63;
  line-height: 1.5;
}

.g51-comment-login-prompt .g51-btn,
.g51-comment-login-prompt__btn {
  min-width: 140px;
  min-height: 42px;
}

.g51-comment-login-prompt__footer {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  color: #5c6b63;
}

.g51-comment-login-prompt__footer a {
  color: #e85d4c;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.g51-comment-login-prompt__footer a:hover {
  filter: brightness(1.08);
}

/* ——— Compose form ——— */
.g51-comment-form {
  display: grid;
  gap: 12px;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  padding: 16px;
  margin-bottom: 18px;
}

.g51-comment-form[hidden] {
  display: none !important;
}

.g51-comment-form-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.g51-comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #1a1f1c;
  background: #d4a017;
  border: 2px solid rgba(212, 160, 23, 0.16);
}

.g51-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g51-comment-author {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #1a1f1c;
}

.g51-rating-input {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
}

.g51-rating-star {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #8a968e;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s ease, transform 0.12s ease;
}

.g51-rating-star.active,
.g51-rating-star:hover {
  color: #d4a017;
}

.g51-rating-star:hover {
  transform: scale(1.08);
}

.g51-comment-textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1a1f1c;
  background: #ffffff;
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  resize: vertical;
  outline: none;
  margin-bottom: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g51-comment-textarea::placeholder {
  color: #5c6b63;
  opacity: 0.85;
}

.g51-comment-textarea:focus {
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.16);
}

.g51-btn-post-comment {
  justify-self: start;
  min-height: 42px;
  padding: 0 20px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1a1f1c;
  background: #d4a017;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.g51-btn-post-comment:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ——— List ——— */
.g51-comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.g51-comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: #ffffff;
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  transition: border-color 0.15s ease;
}

.g51-comment-item:hover {
  border-color: #d4a017;
}

.g51-comment-item--folded {
  display: none;
}

.g51-comment-item .g51-comment-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.85rem;
  margin-top: 2px;
}

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

.g51-comment-meta-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.g51-comment-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: #1a1f1c;
}

.g51-comment-time {
  font-size: 0.75rem;
  color: #5c6b63;
}

.g51-comment-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
  color: #d4a017;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.g51-comment-star {
  color: #8a968e;
  font-style: normal;
  line-height: 1;
}

.g51-comment-star.is-on {
  color: #d4a017;
}

.g51-comment-rating .fa-star,
.g51-comment-rating .fa-star-o {
  font-style: normal;
  font-family: inherit;
}
.g51-comment-rating .fa-star::before { content: "★"; }
.g51-comment-rating .fa-star-o::before { content: "☆"; color: #8a968e; }

.g51-comment-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #5c6b63;
  word-break: break-word;
}

/* ——— Empty / loading / actions ——— */
.g51-comments-empty {
  text-align: center;
  padding: 28px 16px;
  color: #5c6b63;
  background: rgba(212, 160, 23, 0.16);
  border: 1px dashed rgba(26, 31, 28, 0.14);
  border-radius: 2px;
}

.g51-comments-empty p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.g51-loading {
  text-align: center;
  padding: 1.5rem;
  color: #5c6b63;
}

.g51-loading[hidden],
.g51-comments-empty[hidden] {
  display: none !important;
}

.g51-loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(26, 31, 28, 0.14);
  border-top-color: #d4a017;
  border-radius: 50%;
  animation: g51-detail-spin 0.7s linear infinite;
}

@keyframes g51-detail-spin {
  to { transform: rotate(360deg); }
}

#commentsActions,
.g51-comment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.g51-btn-load-comments,
#commentsLoadMore.g51-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 42px;
  margin: 0;
  padding: 0 22px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a1f1c;
  background: #ffffff;
  border: 1px solid rgba(26, 31, 28, 0.14);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.g51-btn-load-comments--expand {
  min-width: 140px;
  gap: 8px;
}

.g51-btn-load-comments[hidden],
#commentsLoadMore[hidden],
.g51-comment-actions .g51-btn-load-comments[hidden] {
  display: none !important;
}

.g51-btn-load-comments:hover,
#commentsLoadMore.g51-btn:hover {
  color: #1a1f1c;
  background: #d4a017;
  border-color: #d4a017;
}

/* ——— Toast ——— */
.g51-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 40000;
  max-width: min(420px, 90vw);
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  border-radius: 2px;
  border: 1px solid transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.28s ease;
  pointer-events: none;
}

.g51-toast.show {
  transform: translateX(-50%) translateY(0);
}

.g51-toast.success {
  color: #1a1f1c;
  background: #d4a017;
  border-color: #d4a017;
}

.g51-toast.error {
  color: #fecaca;
  background: #3f1515;
  border-color: #f87171;
}

.g51-toast.warning {
  color: #1c1400;
  background: #d4a017;
  border-color: #d4a017;
}

@media (max-width: 767px) {
  .g51-comments-section {
    padding: 16px 14px 18px;
  }

  .g51-comment-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .g51-comment-item .g51-comment-avatar {
    width: 32px;
    height: 32px;
  }

  .g51-rating-star {
    width: 40px;
    height: 40px;
  }

  .g51-btn-post-comment {
    width: 100%;
    justify-self: stretch;
  }

  .g51-comment-rating {
    margin-left: 0;
    flex-basis: 100%;
  }

  .g51-toast {
    font-size: 0.8125rem;
    padding: 10px 16px;
  }
}
