:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #1b2028;
  --panel-strong: #242b35;
  --text: #f4f1e8;
  --muted: #aeb7c2;
  --line: #313a46;
  --accent: #3fbf90;
  --accent-dark: #268060;
  --danger: #ff8b8b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 72px) 20px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(100%, 900px);
}

.site-header .ghost-link {
  flex: 0 0 auto;
  height: 42px;
  max-height: 42px;
  white-space: nowrap;
}

.header-search {
  flex: 0 0 260px;
  width: 260px;
  margin: 0;
  color: transparent;
}

.header-search input {
  width: 100%;
}

select.header-select {
  flex: 0 0 240px;
  width: 240px;
  min-height: 42px;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  max-width: 210px;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  width: auto;
  min-height: 42px;
  max-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu img {
  display: block;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
  overflow: hidden;
}

.account-menu summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__body {
  position: absolute;
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 150px;
  margin-top: 8px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.account-menu__body a {
  padding: 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}

.account-menu__body a:hover {
  background: var(--panel-strong);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: stretch;
  gap: 22px;
  padding: 32px clamp(18px, 5vw, 72px) 56px;
}

.game-card {
  position: relative;
  display: grid;
  --cover-height: 290px;
  grid-template-rows: var(--cover-height) 146px;
  height: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.game-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--panel-strong);
  border-radius: 14px 14px 0 0;
}

.game-card__body {
  display: grid;
  grid-template-rows: 48px 1fr;
  height: 146px;
  gap: 10px;
  padding: 16px 16px 70px;
}

.game-card__body h2 {
  display: -webkit-box;
  height: 48px;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.button,
.ghost-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ghost-link--wide {
  width: 100%;
  margin-top: 12px;
}

.button {
  background: var(--accent);
  color: #07130f;
}

.button:hover {
  background: #64d4aa;
}

.game-card__body .button {
  position: absolute;
  right: 16px;
  left: 16px;
  top: calc(var(--cover-height) + var(--button-cover-offset, 76px));
  width: 100%;
  width: auto;
  align-self: end;
  z-index: 2;
}

.button--disabled,
.button--disabled:hover,
.button--coming-soon,
.button--coming-soon:hover {
  background: #59616d;
  color: #d6d8dc;
  cursor: not-allowed;
}

.ghost-button,
.ghost-link {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel--top {
  min-height: auto;
  place-items: start center;
  padding-top: 42px;
}

.request-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 520px));
  justify-content: center;
  align-items: start;
  gap: 24px;
  padding: 42px clamp(18px, 5vw, 72px) 56px;
}

.panel {
  width: min(100%, 520px);
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-layout .panel,
.request-layout .panel {
  width: 100%;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 72px) 56px;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-section-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.admin-lists {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 24px;
  align-items: start;
}

.admin-message,
.admin-search-panel {
  margin: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  width: auto;
  margin: 30px 0 0;
  padding: 0 clamp(18px, 5vw, 72px);
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(63, 191, 144, 0.45), rgba(174, 183, 194, 0.08));
}

.section-heading h2 {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  margin: 0;
  color: #07130f;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.grid--top {
  padding-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
}

textarea {
  min-height: 112px;
  border-radius: 18px;
  resize: vertical;
}

input[type="file"] {
  padding: 9px;
  border-radius: 14px;
}

select {
  cursor: pointer;
}

.hint {
  color: var(--muted);
  line-height: 1.5;
}

.admin-list {
  display: grid;
  gap: 16px;
}

.admin-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: start;
  gap: 16px;
  padding: 14px;
  background: var(--panel-strong);
  border-radius: 14px;
}

.admin-item img {
  width: 90px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel-strong);
  border-radius: 14px;
  overflow: hidden;
}

.admin-user img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 999px;
}

.admin-user div {
  min-width: 0;
}

.admin-user strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user span,
.history-row span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user .button,
.admin-user .ghost-button {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-history {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 170px 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: var(--panel-strong);
  border-radius: 10px;
}

.release-dialog {
  width: min(420px, calc(100% - 32px));
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.release-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.release-dialog form {
  display: grid;
  gap: 14px;
  margin: 0;
}

.admin-lists .admin-item {
  grid-template-columns: 68px 1fr;
}

.admin-lists .admin-item img {
  width: 68px;
}

.admin-item__fields {
  display: grid;
  gap: 12px;
}

.admin-item label {
  margin-bottom: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #190707;
  background: var(--danger);
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.empty--search {
  margin: 24px clamp(18px, 5vw, 72px);
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.success {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .header-search {
    width: 100%;
  }

  .header-actions {
    justify-content: flex-start;
  }

  select.header-select,
  .header-search {
    flex-basis: 100%;
    width: 100%;
  }

  .account-menu {
    max-width: 100%;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .game-card__body h2 {
    font-size: 15px;
  }

  .game-card {
    --cover-height: 225px;
    grid-template-rows: var(--cover-height) 146px;
  }

  .admin-tools,
  .admin-lists,
  .admin-section-nav,
  .request-layout {
    grid-template-columns: 1fr;
  }

  .admin-item {
    grid-template-columns: 72px 1fr;
  }

  .admin-item img {
    width: 72px;
  }
}
