/* Support tickets: /support (form) and /support/t/<no>/<token> (ticket). Dark panels in the launcher window style;
   the site's variables and fonts come from styles.css. */

/* heading: title on the left, three facts on the right */
body.support-page .support-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.support-facts {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.support-facts li {
  display: grid;
  gap: 3px;
  padding: 4px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.support-facts li:first-child {
  padding-left: 0;
  border-left: 0;
}

.support-facts small {
  color: var(--orange, #f4a411);
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.support-facts b,
.support-facts a {
  color: #f1ecd6;
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.support-facts a {
  color: var(--orange-bright, #ffd33d);
  text-decoration: none;
}

.support-facts a:hover {
  text-decoration: underline;
}

.support-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* body and panels */
.support-body {
  display: grid;
  gap: 16px;
  padding: 22px 26px 4px;
}

.support-panel {
  min-width: 0;
  border: 1px solid #1a1b16;
  border-radius: 10px;
  padding: 4px 24px;
  color: #e8e3cf;
  background: linear-gradient(180deg, #34362f, #2b2d27 120px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.support-panel[hidden],
.support-field[hidden],
.support-step[hidden],
.support-hint[hidden] {
  display: none !important;
}

.support-panel h2 {
  margin: 0;
  color: #f1ecd6;
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* form steps: explanation on the left, fields on the right */
.support-step {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.support-step:first-child {
  border-top: 0;
}

.support-step-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  align-content: start;
  column-gap: 8px;
}

.support-step-head p {
  grid-column: 1 / -1;
}

.support-step-head span {
  color: var(--orange, #f4a411);
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.support-step-head h2 {
  margin: 0 0 6px;
}

.support-step-head p {
  margin: 0;
  color: #8f9184;
  font-size: 12px;
  line-height: 1.5;
}

.support-step-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.support-step-send {
  padding-bottom: 24px;
}

/* the attachments step: the drop area as tall as the explanation beside it; the list of files, once there is one,
   keeps its own height below */
.support-step[data-support-attach] .support-step-body {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
}

.support-step[data-support-attach] .support-step-body:has(> .support-file-list:empty) {
  grid-template-rows: minmax(0, 1fr);
}

.support-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* fields */
.support-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.support-field > span {
  color: #a4a797;
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.support-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.support-field input,
.support-field select,
.support-field textarea {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #0c0d0a;
  border-radius: 7px;
  padding: 10px 14px;
  outline: 0;
  color: #f4f2df;
  color-scheme: dark;
  background: linear-gradient(180deg, #2b2d27 0, #171815 18px, #10110f 68%, #1b1c18 100%);
  box-shadow:
    inset 0 1px 0 #737469,
    inset 0 -2px 0 #070806,
    inset 0 0 0 1px #383a33,
    0 1px 0 #5a5b51;
  font-family: "Contra Tahoma Regular", Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

/* the browser's own arrow sits at the very edge and ignores padding: our chevron, 14px in */
.support-field select {
  padding-right: 42px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23d9d5c1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px,
    linear-gradient(180deg, #2b2d27 0, #171815 18px, #10110f 68%, #1b1c18 100%);
}

.support-field select:focus {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23f4a411' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px,
    linear-gradient(180deg, #2b2d27 0, #171815 18px, #10110f 68%, #1b1c18 100%);
}

.support-field select option {
  color: #f4f2df;
  background: #171815;
}

.support-field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

.support-field input::placeholder,
.support-field textarea::placeholder {
  color: #676a60;
}

.support-field input:focus,
.support-field select:focus,
.support-field textarea:focus {
  box-shadow: inset 0 0 0 1px var(--orange, #f4a411), 0 0 0 1px #080805, 0 0 10px rgba(244, 164, 17, 0.18);
}

.support-field input[readonly] {
  color: #989b8f;
}

.support-count {
  justify-self: end;
  color: #7f8175;
  font-size: 11px;
}

.support-hint {
  margin: 0;
  border-left: 3px solid var(--orange, #f4a411);
  border-radius: 0 7px 7px 0;
  padding: 10px 14px;
  background: rgba(244, 164, 17, 0.08);
  color: #d9d5c1;
  font-size: 13px;
  line-height: 1.5;
}

.support-warning {
  position: relative;
  margin: 0;
  padding-left: 24px;
  color: #d99a84;
  font-size: 12px;
  line-height: 1.5;
}

.support-warning::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8f3a22;
  color: #fff1ea;
  content: "!";
  font-size: 11px;
  font-weight: 700;
}

/* attachments */
.support-drop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: baseline;
  gap: 4px 6px;
  border: 2px dashed #4c4d42;
  border-radius: 8px;
  padding: 20px 14px;
  background: rgba(0, 0, 0, 0.22);
  color: #a4a797;
  font-size: 13px;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.support-drop.is-over {
  border-color: var(--green, #9bc400);
  background: rgba(155, 196, 0, 0.08);
}

.support-drop-button,
.support-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange-bright, #ffd33d);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.support-drop-button:hover,
.support-link-button:hover {
  color: #fff2b0;
}

.support-file-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.support-file-list:empty {
  display: none;
}

.support-file {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid #0c0d0a;
  border-radius: 7px;
  padding: 10px 12px 12px;
  background: #171815;
  box-shadow: inset 0 1px #4a4b43;
  font-size: 13px;
}

.support-file-name {
  overflow: hidden;
  color: #f4f2df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-file-status {
  color: #a4a797;
}

.support-file.is-done .support-file-status {
  color: var(--green-bright, #c9f10c);
}

.support-file.is-failed .support-file-status {
  color: #ff8a66;
}

.support-file .support-link-button {
  font-size: 12px;
}

.support-file .support-link-button[hidden] {
  display: none;
}

.support-file-remove {
  min-width: 28px;
  min-height: 28px;
  border: 0;
  background: none;
  color: #a4a797;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.support-file-remove:hover {
  color: #fffdf0;
}

.support-file-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #6f8a00, #aac713);
  transition: width 200ms linear;
}

.support-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.support-error {
  margin: 0;
  border: 1px solid #8f3a22;
  border-radius: 7px;
  padding: 10px 13px;
  background: rgba(239, 99, 60, 0.12);
  color: #ffb49c;
  font-size: 13px;
  font-weight: 700;
}

/* the site's own green button (.game-button in styles.css), as on the home page and in the shop */
body.support-page .support-submit {
  align-self: flex-start;
  justify-self: start;
  width: auto;
  min-width: 240px;
  margin-top: 0;
}

body.support-page a.support-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

body.support-page .support-submit:disabled {
  filter: grayscale(0.8) brightness(0.8);
  cursor: default;
}

/* done, my tickets, requisites */
.support-done {
  padding: 22px 24px;
  background: linear-gradient(90deg, rgba(155, 196, 0, 0.12), transparent 60%), #2b2d27;
  box-shadow: inset 4px 0 #9bc400, 0 6px 18px rgba(0, 0, 0, 0.35);
}

.support-done p {
  margin: 8px 0 16px;
  color: #b8b9ab;
  line-height: 1.5;
}

.support-done strong {
  color: #f1ecd6;
}

/* "Создать обращение" / "Мои обращения": two tabs above the form, in the page from the start */
.support-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.support-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;  /* fixed: the count arriving later must not move the page */
  box-sizing: border-box;
  margin-bottom: -1px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #a4a797;
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.support-tab:hover,
.support-tab:focus-visible {
  color: #f1ecd6;
  outline: none;
}

.support-tab.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #34362f, #2b2d27);
  color: var(--orange-bright, #ffd33d);
  box-shadow: inset 0 2px var(--orange, #f4a411);
}

.support-tab b {
  min-width: 20px;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 17px;
  background: rgba(244, 164, 17, 0.16);
  color: var(--orange-bright, #ffd33d);
  font-size: 11px;
  letter-spacing: 0;
  text-align: center;
}

.support-tab.has-answer::after {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9bc400;
  box-shadow: 0 0 6px #9bc400;
  content: "";
}

.support-mine {
  padding: 16px 24px 8px;
}

.support-mine-empty {
  margin: 4px 0 12px;
  color: #a4a797;
  line-height: 1.5;
}

.support-mine-empty a {
  color: var(--orange-bright, #ffd33d);
  font-weight: 700;
}

@media (max-width: 560px) {
  .support-tab {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }
}

.support-mine h2,
.support-reply h2 {
  color: var(--orange, #f4a411);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.support-mine-list {
  display: grid;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.support-mine-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 9px 0;
}

.support-mine-item a {
  overflow: hidden;
  color: #f1ecd6;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-mine-item a:hover {
  color: var(--orange-bright, #ffd33d);
}

.support-mine-item small {
  grid-column: 1 / -1;
  color: #7f8175;
  font-size: 11px;
}

.support-requisites {
  color: #7f8175;
  font-size: 12px;
}

.support-requisites summary {
  width: max-content;
  color: #a4a797;
  cursor: pointer;
}

.support-requisites p {
  max-width: 760px;
  margin: 6px 0 0;
  line-height: 1.5;
}

.support-requisites a {
  color: #a4a797;
}

/* status badges */
.support-badge {
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  background: #34352c;
  color: #e3dfca;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.support-badge.is-open {
  background: #5a3f05;
  color: var(--orange-bright, #ffd33d);
}

.support-badge.is-answered {
  background: #3b4a06;
  color: var(--green-bright, #c9f10c);
}

.support-badge:empty {
  display: none;
}

/* ticket thread and reply */
.support-thread {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.support-thread:empty {
  display: none;
}

.support-message {
  border: 1px solid #34352c;
  border-radius: 10px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.22);
}

.support-message.is-staff {
  border-color: rgba(155, 196, 0, 0.35);
  background: linear-gradient(90deg, rgba(155, 196, 0, 0.1), rgba(0, 0, 0, 0.2) 70%);
  box-shadow: inset 4px 0 #9bc400;
}

.support-message-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 8px;
  color: #7f8175;
  font-size: 12px;
}

.support-message-head strong {
  color: #f1ecd6;
  font-family: "Contra Tahoma", Tahoma, Arial, sans-serif;
}

.support-message.is-staff .support-message-head strong {
  color: var(--green-bright, #c9f10c);
}

.support-message-body {
  margin: 0;
  color: #e8e3cf;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.support-attachment {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 60px;
  border: 1px solid #0c0d0a;
  border-radius: 7px;
  padding: 6px;
  background: #171815;
  color: #a4a797;
  font-size: 11px;
}

.support-attachment img,
.support-attachment video {
  display: block;
  width: 100%;
  max-height: 260px;
  border-radius: 5px;
  object-fit: contain;
  background: #0b0c09;
}

.support-attachment small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-attachment-wait {
  align-self: center;
  justify-self: center;
  padding: 18px 6px;
  text-align: center;
}

.support-reply {
  display: grid;
  gap: 12px;
  padding: 18px 24px 22px;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.support-actions .support-link-button {
  color: #8f9184;
  font-size: 13px;
  font-weight: 400;
}

.support-actions .support-link-button:hover {
  color: #ff9a7a;
}

.support-closed {
  margin: 0;
  color: #a4a797;
}

.support-closed a {
  color: var(--orange-bright, #ffd33d);
}

/* narrower windows and phones */
@media (max-width: 900px) {
  .support-step {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  body.support-page .support-heading {
    display: grid;
    gap: 14px;
  }

  .support-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .support-facts li,
  .support-facts li:first-child {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
  }

  .support-facts b,
  .support-facts a {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .support-body {
    gap: 12px;
    padding: 14px 10px 4px;
  }

  .support-panel {
    padding: 2px 14px;
  }

  .support-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 16px 0;
  }

  .support-step-head h2 {
    margin: 0;
  }

  .support-step-head p {
    margin-top: 4px;
  }

  .support-step-send .support-step-head {
    display: none;
  }

  /* 16px keeps iOS from zooming into the field */
  .support-field input,
  .support-field select,
  .support-field textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .support-field textarea {
    min-height: 140px;
  }

  body.support-page .support-submit {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .support-done,
  .support-mine,
  .support-reply {
    padding: 16px 14px;
  }

  .support-mine {
    padding-bottom: 6px;
  }

  .support-actions {
    justify-content: center;
  }

  .support-message {
    padding: 12px 14px;
  }

  .support-message-files {
    grid-template-columns: minmax(0, 1fr);
  }

  .support-file {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .support-file-status {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 460px) {
  .support-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .support-facts li,
  .support-facts li:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
}

/* touch screens: a real button instead of "drag here" */
@media (hover: none) {
  .support-drop {
    padding: 0;
    border: 0;
    background: none;
  }

  .support-drop-alt {
    display: none;
  }

  .support-drop-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid #5b5c4d;
    border-radius: 7px;
    background: #1b1c17;
    text-decoration: none;
  }
}

/* The heading exactly as the shop's at every width (m8zk 28.09: «сделай все как во вкладке магазин»): the old support
   page's own paddings (20/26/18, 18/16/16), no minimum height and the phone grid made it sit differently. */
body.support-page .support-heading {
  min-height: 118px;
  padding: 22px 28px;
  gap: 16px 22px;
}

@media (max-width: 780px) {
  body.support-page .support-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 20px;
  }
}

@media (max-width: 520px) {
  body.support-page .support-heading {
    padding: 18px 14px;
  }
}
