/* Account controls extend the existing Igroteka design. */
[hidden] {
  display: none !important;
}
.account {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.account button,
.account a,
.admin-panel button.secondary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--purple-dark);
  padding: 8px 12px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}
.account .account-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account details {
  position: relative;
}
.account summary {
  cursor: pointer;
  padding: 8px;
}
.account-menu {
  position: absolute;
  right: 0;
  top: 100%;
  display: grid;
  min-width: 190px;
  gap: 7px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px #38284c26;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.auth-dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  padding: 28px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-shadow: 0 24px 80px #26223040;
}
.auth-dialog::backdrop {
  background: #26223099;
  backdrop-filter: blur(5px);
}
.auth-dialog h1 {
  font-size: 24px;
  margin: 18px 0 24px;
}
.auth-dialog .title-input {
  display: block;
  margin: 7px 0 16px;
}
.auth-dialog #close-auth {
  margin-left: auto;
}
.app-notice {
  color: var(--purple-dark);
  background: #f0ebff;
  border: 1px solid #d8cdf8;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 48px;
  margin-bottom: 48px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.auth-dialog .app-notice {
  width: 100%;
  margin: 16px 0;
}
.admin-panel {
  margin-block: 48px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.guest-library {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.success-card a {
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .topnav {
    display: none;
  }
  .account {
    gap: 4px;
    font-size: 11px;
  }
  .account .account-name {
    max-width: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.auth-dialog {
  padding: 32px;
  border-radius: 24px;
}
.auth-dialog #close-auth {
  margin-bottom: 20px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  background: #f0ebf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-tabs button {
  border: 0;
  border-radius: 8px;
  padding: 12px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.auth-tabs button[aria-selected="true"] {
  color: white;
  background: var(--purple);
  box-shadow: 0 3px 9px #4b369d26;
}
.auth-dialog h1 {
  margin: 26px 0 8px;
  font-size: 25px;
  letter-spacing: -0.035em;
}
.auth-description {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
  margin: 0 0 24px;
}
.auth-dialog .publish-button {
  margin-top: 8px;
}
.library-layout.library-locked {
  grid-template-columns: 1fr;
}
.admin-panel {
  padding: 0;
  background: transparent;
  border: 0;
}
.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  margin-bottom: 28px;
}
.admin-kicker {
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 9px;
}
.admin-heading h1 {
  margin: 0 0 12px;
  letter-spacing: -0.04em;
  font-size: 34px;
}
.admin-heading p:last-child {
  max-width: 650px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.admin-back {
  white-space: nowrap;
  color: var(--purple-dark);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 11px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}
.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.admin-summary > div {
  display: grid;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.admin-summary strong {
  font-size: 30px;
  letter-spacing: -0.04em;
}
.admin-summary span {
  font-size: 12px;
  color: var(--muted);
}
.admin-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-toolbar .game-search {
  flex: 1;
  min-height: 46px;
}
.admin-toolbar .sort-select {
  width: 210px;
  min-height: 46px;
}
.user-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.user-table th {
  padding: 17px 22px;
  font-size: 11px;
  color: var(--muted);
  background: #f0ebf866;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
.user-table td {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.user-table tr:last-child td {
  border-bottom: 0;
}
.user-table td:first-child {
  width: 45%;
  overflow-wrap: anywhere;
}
.user-table th:last-child,
.user-table td:last-child {
  text-align: right;
}
.user-table strong {
  display: block;
  font-weight: 700;
  font-size: 14px;
}
.user-email {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 12px;
}
.access-badge {
  display: inline-flex;
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
}
.access-allowed {
  background: #e6f3ec;
  color: #287653;
}
.access-denied {
  background: #f0ebf8;
  color: #6a6078;
}
.access-grant,
.access-revoke {
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  border-radius: 9px;
  padding: 10px 14px;
  white-space: nowrap;
}
.access-grant {
  border: 1px solid var(--purple);
  background: var(--purple);
  color: white;
}
.access-grant:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
}
.access-revoke {
  border: 1px solid #ddc5c0;
  background: #fff8f6;
  color: #a94c3a;
}
.access-revoke:hover {
  background: #ffede8;
}
.admin-role {
  color: var(--muted);
  font-size: 12px;
}
.admin-status {
  background: #e6f3ec;
  border: 1px solid #abd2bd;
  color: #287653;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 13px;
}
.admin-empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 650px) {
  .admin-heading {
    flex-direction: column;
    gap: 18px;
  }
  .admin-heading h1 {
    font-size: 28px;
  }
  .admin-summary {
    gap: 7px;
  }
  .admin-summary > div {
    padding: 16px 12px;
  }
  .admin-summary strong {
    font-size: 26px;
  }
  .admin-summary span {
    font-size: 11px;
  }
  .admin-toolbar {
    flex-direction: column;
  }
  .admin-toolbar .sort-select {
    width: 100%;
  }
  .user-table thead {
    display: none;
  }
  .user-table tbody,
  .user-table tr {
    display: block;
  }
  .user-table tr {
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }
  .user-table tr:last-child {
    border-bottom: 0;
  }
  .user-table td {
    display: block;
    padding: 0 0 14px;
    border: 0;
  }
  .user-table td:first-child {
    width: 100%;
  }
  .user-table td:last-child {
    padding-bottom: 0;
    text-align: left;
  }
  .auth-dialog {
    padding: 24px;
  }
}
