/* Управление собственными комментариями в карточке игры. */
.game-modal .modal-comment-body {
  min-width: 0;
}

.game-modal .modal-comment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16rem;
}

.game-modal .modal-comment-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8rem;
}

.game-modal .modal-comment-action,
.game-modal .modal-comment-edit-actions button {
  min-height: 32rem;
  padding: 6rem 10rem;
  border: 1rem solid rgba(240, 240, 240, .12);
  border-radius: 5rem;
  color: rgba(240, 240, 240, .72);
  background: #202020;
  font-family: var(--font-ui);
  font-size: 14rem;
  font-weight: 500;
  line-height: 1;
  transition:
    color .18s ease,
    border-color .18s ease,
    background .18s ease,
    opacity .18s ease;
}

.game-modal .modal-comment-action:hover,
.game-modal .modal-comment-edit-actions button:hover {
  color: #f0f0f0;
  border-color: rgba(240, 240, 240, .3);
  background: #292929;
}

.game-modal .modal-comment-action.is-danger {
  color: rgba(239, 58, 60, .8);
}

.game-modal .modal-comment-action.is-danger:hover {
  color: #ff7779;
  border-color: rgba(239, 58, 60, .35);
  background: rgba(239, 58, 60, .08);
}

.game-modal .modal-comment-meta {
  display: flex;
  align-items: center;
  gap: 10rem;
  flex-wrap: wrap;
}

.game-modal .modal-comment-edited {
  color: rgba(240, 240, 240, .3);
  font-family: var(--font-ui);
  font-size: 14rem;
  font-weight: 400;
  line-height: 1.45;
}

.game-modal .modal-comment-edit {
  display: grid;
  gap: 10rem;
  margin-top: 8rem;
}

.game-modal .modal-comment-edit textarea {
  width: 100%;
  min-height: 88rem;
  max-height: 220rem;
  padding: 14rem 16rem;
  resize: vertical;
  border: 1rem solid rgba(240, 240, 240, .14);
  border-radius: 6rem;
  outline: 0;
  color: #f0f0f0;
  background: #181818;
  font-family: var(--font-body);
  font-size: 20rem;
  font-weight: 400;
  line-height: 1.35;
}

.game-modal .modal-comment-edit textarea:focus {
  border-color: rgba(239, 58, 60, .58);
  box-shadow: 0 0 0 2rem rgba(239, 58, 60, .08);
}

.game-modal .modal-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8rem;
}

.game-modal .modal-comment-edit-actions button:first-child {
  color: #f0f0f0;
  border-color: rgba(239, 58, 60, .38);
  background: rgba(239, 58, 60, .12);
}

.game-modal .modal-comment-item.is-editing > .modal-comment-body > .modal-comment-head .modal-comment-actions {
  display: none;
}

.game-modal .modal-comment-item.is-busy {
  opacity: .62;
  pointer-events: none;
}

.game-modal .modal-comment-action:disabled,
.game-modal .modal-comment-edit-actions button:disabled {
  cursor: wait;
  opacity: .5;
}

@media (max-width: 45rem) {
  .game-modal .modal-comment-head {
    flex-direction: column;
    gap: 8rem;
  }

  .game-modal .modal-comment-actions {
    width: 100%;
  }

  .game-modal .modal-comment-action {
    flex: 1 1 auto;
  }

  .game-modal .modal-comment-edit-actions button {
    flex: 1 1 0;
  }
}

/* Split game card: game information on the left, discussion on the right. */
@media (min-width: 901px) {
  .game-modal .modal-panel {
    width: 1280rem !important;
    height: 760rem !important;
    min-height: 760rem !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.55fr) minmax(420rem, .95fr);
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 14rem;
    background:
      radial-gradient(circle at 7% 4%, rgba(220, 44, 31, .13), transparent 46%),
      linear-gradient(145deg, #151313, #090909 60%, #110b0b) !important;
  }

  .game-modal .modal-game-column {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    background: transparent;
  }

  .game-modal .modal-game-column::-webkit-scrollbar,
  .game-modal .modal-comments-list::-webkit-scrollbar {
    display: none;
  }

  .game-modal .modal-media {
    width: calc(100% - 72rem);
    height: 250rem !important;
    min-height: 250rem;
    margin: 36rem auto 0;
  }

  .game-modal .modal-badges {
    top: 54rem;
    left: 52rem;
  }

  .game-modal .modal-content {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 36rem 24rem;
  }

  .game-modal .modal-release {
    margin: 18rem 0;
  }

  .game-modal .modal-title {
    max-height: 102rem;
    margin-bottom: 18rem;
    font-size: clamp(44rem, 4vw, 56rem);
  }

  .game-modal #modalDescription {
    max-height: 84rem;
    overflow-y: auto;
  }

  .game-modal .modal-footer {
    position: static !important;
    margin-top: 24rem;
  }

  .game-modal .modal-steam,
  .game-modal .modal-reactions button {
    height: 64rem;
    min-height: 64rem;
  }

  .game-modal .modal-reaction-notice {
    position: static !important;
    min-height: 18rem;
    margin-top: 10rem;
  }

  .game-modal .modal-comments-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 34rem 30rem 30rem;
    border-left: 0;
    background: transparent;
  }

  .game-modal .modal-comments {
    position: static !important;
    inset: auto !important;
    width: 100%;
    height: auto !important;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin: 20rem 0 0;
    padding: 0;
    border: 0;
  }

  .game-modal .modal-comments-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4rem;
    scrollbar-width: none;
  }
}

.game-modal .modal-comments-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18rem;
}

.game-modal .modal-comments-header > div {
  min-width: 0;
}

.game-modal .modal-comments-header > div > span,
.game-modal .modal-comment-sort-menu small {
  color: #ef3a3c;
  font-family: var(--font-ui);
  font-size: 11rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.game-modal .modal-comments-header h3 {
  display: flex;
  align-items: baseline;
  gap: 9rem;
  margin: 6rem 0 0;
  color: #f0f0f0;
  font-family: var(--font-display);
  font-size: 30rem;
  font-weight: 800;
  line-height: 1;
}

.game-modal .modal-comments-header h3 b {
  color: rgba(240, 240, 240, .35);
  font-family: var(--font-ui);
  font-size: 14rem;
  font-weight: 500;
}

.game-modal .modal-comment-sort {
  position: relative;
  width: 112rem;
  min-width: 0;
}

.game-modal .modal-comment-sort summary {
  min-height: 42rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 26rem 5rem 10rem;
  border: 0;
  border-radius: 6rem;
  color: #f0f0f0;
  background: #202020;
  cursor: pointer;
  list-style: none;
}

.game-modal .modal-comment-sort summary::-webkit-details-marker {
  display: none;
}

.game-modal .modal-comment-sort summary::after {
  position: absolute;
  top: 50%;
  right: 14rem;
  width: 8rem;
  height: 8rem;
  border-right: 2rem solid rgba(240, 240, 240, .45);
  border-bottom: 2rem solid rgba(240, 240, 240, .45);
  content: '';
  transform: translateY(-65%) rotate(45deg);
  transition: transform .18s ease;
}

.game-modal .modal-comment-sort[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.game-modal .modal-comment-sort summary span {
  color: rgba(240, 240, 240, .4);
  font-size: 11rem;
  line-height: 1.1;
}

.game-modal .modal-comment-sort summary b {
  overflow: hidden;
  font-size: 12rem;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-modal .modal-comment-sort-menu {
  position: absolute;
  top: calc(100% + 8rem);
  right: 0;
  width: 244rem;
  display: grid;
  gap: 4rem;
  padding: 14rem;
  border: 1rem solid rgba(240, 240, 240, .12);
  border-radius: 8rem;
  background: #181818;
  box-shadow: 0 18rem 50rem rgba(0, 0, 0, .52);
}

.game-modal .modal-comment-sort-menu small {
  padding: 4rem 10rem 7rem;
  color: rgba(240, 240, 240, .34);
}

.game-modal .modal-comment-sort-menu button {
  min-height: 43rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12rem;
  border: 0;
  border-radius: 5rem;
  color: rgba(240, 240, 240, .68);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 16rem;
  text-align: left;
}

.game-modal .modal-comment-sort-menu button:hover,
.game-modal .modal-comment-sort-menu button.is-active {
  color: #f0f0f0;
  background: #282828;
}

.game-modal .modal-comment-sort-menu button span {
  color: #ef3a3c;
  opacity: 0;
}

.game-modal .modal-comment-sort-menu button.is-active span {
  opacity: 1;
}

.game-modal .modal-comment-item {
  grid-template-columns: 44rem minmax(0, 1fr) !important;
  gap: 12rem !important;
  padding: 15rem 0 !important;
  border-bottom: 1rem solid rgba(240, 240, 240, .07);
}

.game-modal .modal-comment-avatar,
.game-modal .modal-comment-composer-avatar {
  width: 44rem !important;
  height: 44rem !important;
  overflow: hidden;
  font-size: 19rem !important;
}

.game-modal .modal-comment-avatar img,
.game-modal .modal-comment-composer-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.game-modal .modal-comment-item strong {
  font-size: 19rem !important;
}

.game-modal .modal-comment-item p {
  margin: 7rem 0 11rem !important;
  font-size: 15rem !important;
  line-height: 1.4 !important;
}

.game-modal .modal-comment-meta {
  justify-content: space-between;
  gap: 8rem;
}

.game-modal .modal-comment-item time,
.game-modal .modal-comment-edited {
  font-size: 12rem !important;
}

.game-modal .modal-comment-reactions {
  display: flex;
  align-items: center;
  gap: 6rem;
  margin-left: auto;
}

.game-modal .modal-comment-reactions button {
  min-width: 48rem;
  min-height: 34rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7rem;
  padding: 5rem 8rem;
  border: 0;
  border-radius: 5rem;
  color: rgba(240, 240, 240, .42);
  background: #202020;
  font-family: var(--font-ui);
  cursor: pointer;
}

.game-modal .modal-comment-reactions button:hover,
.game-modal .modal-comment-reactions button.is-active {
  color: #f0f0f0;
  background: rgba(239, 58, 60, .18);
}

.game-modal .modal-comment-reactions button:disabled {
  cursor: default;
  opacity: .48;
}

.game-modal .modal-comment-reactions img {
  width: 19rem;
  height: 19rem;
  object-fit: contain;
}

.game-modal .modal-comment-reactions b {
  font-size: 13rem;
  font-weight: 500;
}

.game-modal .modal-comment-actions {
  gap: 5rem;
}

.game-modal .modal-comment-action {
  min-height: 27rem;
  padding: 4rem 7rem;
  font-size: 11rem;
}

.game-modal .modal-comments-column .modal-comment-form {
  flex: 0 0 auto;
  grid-template-columns: 44rem minmax(0, 1fr) 50rem;
  gap: 9rem;
  margin-top: 18rem;
  padding-top: 18rem;
  border-top: 1rem solid rgba(240, 240, 240, .08);
}

.game-modal .modal-comments-column .modal-comment-form textarea {
  min-height: 50rem;
  max-height: 112rem;
  padding: 14rem;
  font-size: 15rem;
}

.game-modal .modal-comments-column .modal-comment-form button {
  width: 50rem;
  min-height: 50rem;
}

.game-modal .modal-comments-column .modal-comment-form button img {
  width: 28rem;
  height: 28rem;
}

.game-modal .modal-comments-column .modal-auth-hint {
  margin: 14rem 0 0;
  font-size: 13rem;
}

@media (max-width: 900px) {
  .game-modal {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16rem;
  }

  .game-modal .modal-panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: min(100%, 760rem) !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto;
    overflow: hidden;
    transform: none !important;
  }

  .game-modal .modal-comments-column {
    padding: 24rem 20rem 30rem;
    border-top: 0;
    background: transparent;
  }

  .game-modal .modal-comments {
    height: auto !important;
    margin: 20rem 0 0;
    padding: 0;
    border: 0;
  }

  .game-modal .modal-comments-list {
    max-height: 480rem;
    overflow-y: auto;
  }
}

@media (max-width: 560px) {
  .game-modal .modal-comments-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .game-modal .modal-comment-sort {
    width: 100%;
    flex-basis: auto;
  }

  .game-modal .modal-comment-sort-menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  .game-modal .modal-comment-head {
    align-items: flex-start;
  }

  .game-modal .modal-comment-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-modal .modal-comment-reactions {
    margin-left: 0;
  }
}

/* Keep the fitted geometry frozen while the modal disappears. */
@media (min-width: 901px) {
  .game-modal.is-closing .modal-panel {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(0) scale(var(--game-modal-scale, 1)) !important;
    transition: opacity .14s ease !important;
  }

  .game-modal.is-closing .modal-backdrop {
    opacity: 0 !important;
    transition-duration: .14s !important;
  }
}

@media (max-width: 900px) {
  .game-modal.is-closing .modal-panel {
    opacity: 0 !important;
    transform: none !important;
    transition: opacity .14s ease !important;
  }
}

/* Final adaptive game window. Mirrors the viewport-based media dialog and
   overrides the legacy .is-open geometry from figma-main-final.css. */
html body .game-modal:not([hidden]) .modal-backdrop {
  opacity: 1 !important;
}

html body .game-modal:not([hidden]) .modal-panel {
  visibility: visible !important;
  opacity: 1 !important;
}

.game-modal .modal-content,
.game-modal .modal-section,
.game-modal .modal-game-column,
.game-modal .modal-comments-column,
.game-modal .modal-comments,
.game-modal .modal-comments-header {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.game-modal .modal-content::before,
.game-modal .modal-content::after,
.game-modal .modal-section::before,
.game-modal .modal-section::after,
.game-modal .modal-comments::before,
.game-modal .modal-comments::after,
.game-modal .modal-comments-column::before,
.game-modal .modal-comments-column::after {
  display: none !important;
  content: none !important;
}

.game-modal .modal-comment-item,
.game-modal .modal-comments-column .modal-comment-form {
  border: 0 !important;
}

.game-modal #modalDescription {
  overflow: hidden !important;
}

.game-modal .modal-media {
  display: grid !important;
  place-items: center;
  background-color: #080808 !important;
  background-image: none !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.game-modal .modal-media::before,
.game-modal .modal-media::after {
  display: none !important;
  content: none !important;
}

.game-modal .modal-media img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: none !important;
}

@media (min-width: 768px) {
  .game-modal {
    overflow: hidden !important;
  }

  .game-modal .modal-panel,
  .game-modal.is-open .modal-panel,
  .game-modal.is-closing .modal-panel {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: min(1120px, calc(100vw - 96px)) !important;
    height: min(700px, calc(100dvh - 96px)) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: calc(100vw - 96px) !important;
    max-height: calc(100dvh - 96px) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr) !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 14px !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
    transform-origin: center !important;
    background:
      radial-gradient(circle at 7% 4%, rgba(220, 44, 31, .13), transparent 46%),
      linear-gradient(145deg, #151313, #090909 60%, #110b0b) !important;
    transition: opacity .16s ease !important;
  }

  .game-modal .modal-game-column {
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
  }

  .game-modal .modal-comments-column {
    min-width: 0;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    padding: 32px 30px 28px !important;
    overflow: hidden;
  }

  .game-modal .modal-comments {
    min-height: 0;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
  }

  .game-modal .modal-comments-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
  }

  .game-modal .modal-media {
    width: calc(100% - 72px) !important;
    height: clamp(230px, 36dvh, 310px) !important;
    min-height: 0 !important;
    margin: 36px auto 0 !important;
  }

  html body .game-modal.is-closing:not([hidden]) .modal-panel {
    opacity: 0 !important;
    transform: translate(-50%, -50%) !important;
  }

  html body .game-modal.is-closing:not([hidden]) .modal-backdrop {
    opacity: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 1050px) {
  .game-modal .modal-panel,
  .game-modal.is-open .modal-panel,
  .game-modal.is-closing .modal-panel {
    width: calc(100vw - 64px) !important;
    height: calc(100dvh - 64px) !important;
    max-width: calc(100vw - 64px) !important;
    max-height: calc(100dvh - 64px) !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr) !important;
  }

  .game-modal .modal-comments-column {
    padding: 24px 20px !important;
  }

  .game-modal .modal-comments-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .game-modal .modal-comment-sort {
    width: 100%;
  }

  .game-modal .modal-comment-sort-menu {
    right: auto;
    left: 0;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .game-modal {
    display: grid !important;
    place-items: center;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    padding: 12px !important;
  }

  .game-modal .modal-panel,
  .game-modal.is-open .modal-panel,
  .game-modal.is-closing .modal-panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: min(100%, 620px) !important;
    height: calc(100dvh - 24px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: calc(100dvh - 24px) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(180px, 1fr) !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 12px !important;
    opacity: 1 !important;
    transform: none !important;
    background:
      radial-gradient(circle at 7% 4%, rgba(220, 44, 31, .13), transparent 46%),
      linear-gradient(145deg, #151313, #090909 60%, #110b0b) !important;
    transition: opacity .16s ease !important;
  }

  .game-modal .modal-game-column {
    min-height: 0;
    overflow: hidden !important;
  }

  .game-modal .modal-media {
    width: calc(100% - 32px) !important;
    height: min(180px, 28dvh) !important;
    min-height: 0 !important;
    aspect-ratio: auto;
    margin: 50px auto 0 !important;
  }

  .game-modal .modal-content {
    padding: 0 16px 16px !important;
  }

  .game-modal .modal-release {
    margin: 12px 0 !important;
    font-size: 13px !important;
  }

  .game-modal .modal-title {
    max-height: 72px !important;
    margin: 0 0 10px !important;
    font-size: 36px !important;
  }

  .game-modal #modalDescription {
    max-height: 58px !important;
    display: -webkit-box !important;
    overflow: hidden !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .game-modal .modal-footer {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin: 14px 0 0 !important;
  }

  .game-modal .modal-steam {
    width: auto !important;
    min-width: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    flex: 1 1 auto;
    padding: 10px 14px !important;
    font-size: 20px !important;
  }

  .game-modal .modal-steam img {
    width: 30px !important;
    height: 30px !important;
    flex-basis: 30px !important;
  }

  .game-modal .modal-reactions {
    flex: 0 0 auto;
    gap: 6px !important;
  }

  .game-modal .modal-reactions button {
    min-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 8px !important;
  }

  .game-modal .modal-comments-column {
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    padding: 24px 20px 30px !important;
    overflow: hidden !important;
  }

  .game-modal .modal-comments-header {
    grid-template-columns: minmax(0, 1fr) 140px !important;
    align-items: end;
    gap: 10px;
  }

  .game-modal .modal-comments-header h3 {
    font-size: 25px;
  }

  .game-modal .modal-comment-sort {
    width: 140px;
  }

  .game-modal .modal-comment-sort-menu {
    right: 0;
    left: auto;
    width: min(230px, calc(100vw - 64px));
  }

  .game-modal .modal-comments {
    min-height: 0;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
  }

  .game-modal .modal-comments-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  html body .game-modal.is-closing:not([hidden]) .modal-panel,
  html body .game-modal.is-closing:not([hidden]) .modal-backdrop {
    opacity: 0 !important;
  }
}

/* Game descriptions must never be shortened below the title. */
.game-modal #modalDescription {
  max-height: none !important;
  display: block !important;
  overflow: visible !important;
  -webkit-box-orient: initial !important;
  -webkit-line-clamp: unset !important;
}

@media (min-width: 768px) {
  .game-modal .modal-game-column {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}

.game-modal .modal-comments-header h3,
.game-modal .modal-comments-header h3 b {
  font-family: 'DrukCyr-Heavy', sans-serif !important;
  font-size: 36px !important;
  font-weight: 400 !important;
  line-height: .95 !important;
  letter-spacing: 0 !important;
}

.game-modal .modal-comments-header h3 {
  gap: 10px;
  margin: 0 !important;
}

.game-modal .modal-comments-header h3 b {
  color: rgba(240, 240, 240, .38) !important;
}

@media (max-width: 767px) {
  .game-modal .modal-comments-header h3,
  .game-modal .modal-comments-header h3 b {
    font-size: 28px !important;
  }
}

@media (min-width: 768px) {
  .game-modal .modal-game-column {
    display: flex !important;
    flex-direction: column;
  }

  .game-modal .modal-media {
    height: clamp(220px, 31dvh, 260px) !important;
    flex: 0 0 auto;
    margin-top: 24px !important;
  }

  .game-modal .modal-content {
    min-height: 0 !important;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    padding: 0 28px 18px !important;
  }

  .game-modal .modal-release {
    margin: 12px 0 !important;
    font-size: 15px !important;
  }

  .game-modal .modal-title {
    max-height: 104px !important;
    margin: 0 0 12px !important;
    font-size: clamp(42px, 4vw, 54px) !important;
  }

  .game-modal .modal-section {
    min-height: 0;
    margin: 0 !important;
  }

  .game-modal #modalDescription {
    max-height: none !important;
    height: auto !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  .game-modal .modal-footer {
    position: static !important;
    margin: auto 0 0 !important;
    padding-top: 14px;
  }

  .game-modal .modal-steam,
  .game-modal .modal-reactions button {
    height: 58px !important;
    min-height: 58px !important;
  }

  .game-modal .modal-steam {
    width: min(100%, 350px) !important;
    min-width: 0 !important;
    padding: 10px 18px !important;
    font-size: 24px !important;
  }

  .game-modal .modal-steam img {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  .game-modal .modal-reactions button {
    min-width: 68px !important;
  }

  .game-modal .modal-reaction-notice {
    min-height: 0 !important;
    margin: 5px 0 0 !important;
    font-size: 12px !important;
  }
}

.game-modal .modal-badges {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px !important;
  margin: 18px 0 14px !important;
}

.game-modal .modal-badges .coop-badge,
.game-modal .modal-badges .release-badge {
  min-height: 32px !important;
  padding: 5px 14px !important;
  border: 0 !important;
  border-radius: 6px !important;
  font-size: 16px !important;
}

.game-modal .modal-badges .coop-badge::before {
  display: none !important;
  content: none !important;
}

.game-modal .modal-comments-list,
.game-modal .modal-comment-form textarea,
.game-modal .modal-comment-edit textarea {
  scrollbar-width: thin !important;
  scrollbar-color: #393939 rgba(255, 255, 255, .025) !important;
}

.game-modal .modal-comments-list::-webkit-scrollbar,
.game-modal .modal-comment-form textarea::-webkit-scrollbar,
.game-modal .modal-comment-edit textarea::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}

.game-modal .modal-comments-list::-webkit-scrollbar-track,
.game-modal .modal-comment-form textarea::-webkit-scrollbar-track,
.game-modal .modal-comment-edit textarea::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
}

.game-modal .modal-comments-list::-webkit-scrollbar-thumb,
.game-modal .modal-comment-form textarea::-webkit-scrollbar-thumb,
.game-modal .modal-comment-edit textarea::-webkit-scrollbar-thumb {
  border: 1px solid rgba(10, 10, 10, .55);
  border-radius: 999px;
  background: #393939;
}

.game-modal .modal-comments-list::-webkit-scrollbar-thumb:hover,
.game-modal .modal-comment-form textarea::-webkit-scrollbar-thumb:hover,
.game-modal .modal-comment-edit textarea::-webkit-scrollbar-thumb:hover {
  background: #484848;
}

.game-modal .modal-comment-form textarea {
  box-sizing: border-box !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 112px !important;
  overflow-y: auto !important;
  resize: none !important;
  line-height: 1.4 !important;
}

@media (max-width: 767px) {
  .game-modal .modal-badges {
    gap: 6px !important;
    margin: 12px 0 10px !important;
  }

  .game-modal .modal-badges .coop-badge,
  .game-modal .modal-badges .release-badge {
    min-height: 28px !important;
    padding: 4px 9px !important;
    font-size: 13px !important;
  }
}

/* Narrow screens use the modal itself as the vertical scroll container.
   The page underneath remains locked by body.modal-open. */
@media (max-width: 767px) {
  .game-modal {
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #393939 rgba(255, 255, 255, .025);
  }

  .game-modal .modal-panel,
  .game-modal.is-open .modal-panel,
  .game-modal.is-closing .modal-panel {
    height: auto !important;
    min-height: calc(100dvh - 24px) !important;
    max-height: none !important;
    grid-template-rows: auto auto !important;
    overflow: visible !important;
  }

  .game-modal .modal-game-column,
  .game-modal .modal-comments-column,
  .game-modal .modal-comments {
    overflow: visible !important;
  }

  .game-modal .modal-comments {
    min-height: 0 !important;
    flex: 0 0 auto !important;
  }

  .game-modal .modal-comments-list {
    max-height: min(480px, 52dvh) !important;
    flex: 0 1 auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .game-modal::-webkit-scrollbar {
    width: 6px;
  }

  .game-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .025);
  }

  .game-modal::-webkit-scrollbar-thumb {
    border: 1px solid rgba(10, 10, 10, .55);
    border-radius: 999px;
    background: #393939;
  }
}

/* Short tablet windows keep the desktop composition, but the game column can
   scroll instead of silently cropping its lower controls. */
@media (min-width: 768px) and (max-height: 720px) {
  .game-modal .modal-game-column {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #393939 rgba(255, 255, 255, .025);
  }
}

/* On phones the game column always fills at least one screen. Its action row
   sits at the bottom when the copy is short; longer copy remains fully visible
   and naturally extends the modal's existing page-level scroll container. */
@media (max-width: 767px) {
  .game-modal .modal-game-column {
    min-height: calc(100dvh - 24px) !important;
    display: flex !important;
    flex-direction: column;
    overflow: visible !important;
  }

  .game-modal .modal-media {
    flex: 0 0 auto;
  }

  .game-modal .modal-content {
    min-height: 0;
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .game-modal #modalDescription {
    max-height: none !important;
    display: block !important;
    overflow: visible !important;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
  }

  .game-modal .modal-footer {
    order: 2;
    flex: 0 0 auto;
    margin: auto 0 0 !important;
    padding-top: 16px;
  }

  .game-modal .modal-reaction-notice {
    order: 1;
  }

  .game-modal .modal-comments-header {
    grid-template-columns: minmax(0, 1fr) 118px !important;
    align-items: end !important;
    gap: 8px !important;
  }

  .game-modal .modal-comments-header > div,
  .game-modal .modal-comments-header h3 {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(24px, 7vw, 28px) !important;
    white-space: nowrap;
  }

  .game-modal .modal-comments-header h3 b {
    flex: 0 0 auto;
    font-size: 20px !important;
  }

  .game-modal .modal-comment-sort {
    width: 118px !important;
    justify-self: end;
  }

  .game-modal .modal-comment-sort summary {
    min-height: 44px;
    padding: 6px 26px 6px 10px;
  }

  .game-modal .modal-comment-sort summary span {
    font-size: 9px;
  }

  .game-modal .modal-comment-sort summary b {
    font-size: 12px;
  }

  .game-modal .modal-comment-sort-menu {
    right: 0 !important;
    left: auto !important;
    width: min(200px, calc(100vw - 64px)) !important;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .game-modal .modal-comments-header {
    grid-template-columns: minmax(0, 1fr) 104px !important;
  }

  .game-modal .modal-comment-sort {
    width: 104px !important;
  }

  .game-modal .modal-comment-sort summary b {
    font-size: 11px;
  }
}
