:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111;
  color: #f3f3f3;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
.top {
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1150px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #282828;
}
.brand { font-size: 24px; font-weight: 800; letter-spacing: -.05em; text-decoration: none; }
main { width: min(100% - 32px, 460px); margin: clamp(32px, 12vh, 112px) auto; }
.card { padding: clamp(20px, 5vw, 32px); border: 1px solid #292929; border-radius: 16px; background: #181818; }
.card + .card { margin-top: 16px; }
h1, h2 { margin: 0 0 24px; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(25px, 5vw, 32px); }
h2 { font-size: 20px; }
label { display: block; font-size: 14px; margin: 12px 0 6px; }
input:not([type=hidden]):not([type=checkbox]), select {
  width: 100%;
  padding: 10px 12px;
  color: inherit;
  background: #111;
  border: 1px solid #424242;
  border-radius: 8px;
  font: inherit;
}
label.confirm-grant { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
button { cursor: pointer; font: inherit; }
:focus-visible { outline: 2px solid #9bbaf7; outline-offset: 3px; }
.primary { display: block; width: 100%; padding: 10px; margin-top: 20px; border: 0; border-radius: 8px; background: #eee; color: #111; font-weight: 700; }
.primary:hover { background: #fff; }
.text-button { color: inherit; background: transparent; padding: 8px; border: 0; }
.hint, dt, .grants span { color: #b1b1b1; font-size: 14px; }
.card > .hint:last-child { margin-bottom: 0; }
.error, .errorlist { color: #ffa5a5; }
.errorlist { padding-left: 19px; font-size: 14px; }
.success { color: #acdabc; }
dd { margin: 2px 0 14px; overflow-wrap: anywhere; }
.grants { list-style: none; padding: 0; margin: 0; }
.grants li { padding: 8px 0; border-top: 1px solid #303030; overflow-wrap: anywhere; }
.grants span { display: block; }

.admin-dashboard { width: min(100% - 32px, 940px); }
.grant-panels { display: grid; gap: 16px; }
.grant-panels > .card { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.grant-panels .card > h2 { margin-bottom: 8px; }
.grant-panels .card > .hint { margin: 0; }
.grant-panels form { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.grant-panels + .card { margin-top: 16px; }
@media (min-width: 660px) {
  .grant-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.player-dashboard { width: min(100% - 32px, 940px); margin-top: clamp(32px, 8vh, 80px); }
.profile-heading { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.profile-heading h1 { margin: 0 0 4px; }
.profile-heading p { margin: 0; color: #b1b1b1; overflow-wrap: anywhere; }
.profile-heading > div:last-child { min-width: 0; }
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  aspect-ratio: 1;
  border: 1px solid #393939;
  border-radius: 14px;
  background: #272727;
  color: #ededed;
  font-size: 26px;
  font-weight: 750;
}
.profile-panels { display: grid; gap: 16px; }
.profile-panels > .card { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.profile-card h2 { margin: 0; }
.profile-card-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.membership-status { border-radius: 999px; padding: 4px 10px; background: #252525; color: #c0c0c0; font-size: 13px; }
.membership-status.active { background: #23372c; color: #b2dcbd; }
.membership-status.paused { background: #283445; color: #c3d8f4; }
.membership-detail, .membership-note { margin: 20px 0; }
.membership-detail dd { margin: 5px 0 0; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 650; }
.membership-note { color: #b1b1b1; }
.membership-actions { margin-top: auto; }
.membership-actions .hint { margin: 0 0 12px; }
.preferences-form { margin: 15px 0 16px; }
.preferences-controls { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.preferences-controls select { flex: 1 1 135px; min-width: 0; }
.action-button {
  padding: 9px 12px;
  border: 1px solid #424242;
  border-radius: 8px;
  background: #222;
  color: inherit;
}
.action-button:hover:not(:disabled) { background: #303030; }
.action-button:disabled { cursor: default; opacity: .5; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.admin-link { font-size: 14px; text-decoration: none; white-space: nowrap; }
.profile-avatar { overflow: hidden; }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-setting { border-top: 1px solid #333; margin-top: 4px; padding: 4px 0 16px; }
.avatar-setting .hint { margin: 8px 0 12px; }
.avatar-setting input[type=file] { font-size: 14px; }
.avatar-setting input[type=file]::file-selector-button {
  margin-right: 9px; padding: 4px 8px; border: 1px solid #424242; border-radius: 5px;
  background: #262626; color: #ededed; cursor: pointer;
}
.profile-link { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid #333; text-decoration: none; }
.profile-link:hover { text-decoration: underline; }
.account-feedback { border: 1px solid #424242; border-radius: 8px; padding: 10px 14px; }
.back-link { display: inline-block; margin-bottom: 20px; color: #b1b1b1; }
.support-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.support-heading h1 { margin: 0; }
.admin-dashboard > .support-heading { margin-bottom: 24px; }
.support-grid { display: grid; align-items: start; gap: 16px; }
.support-grid > .card { min-width: 0; margin: 0; }
.ticket-list, .ticket-messages { list-style: none; padding: 0; margin: 0; }
.ticket-list a { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid #303030; text-decoration: none; overflow-wrap: anywhere; }
.ticket-list a:hover strong { text-decoration: underline; }
.ticket-pages { display: flex; gap: 14px; margin-top: 14px; }
.ticket-thread h1 { margin-bottom: 8px; overflow-wrap: anywhere; }
.ticket-messages { display: grid; gap: 8px; margin: 18px 0; }
.ticket-message { padding: 12px 14px; border: 1px solid #343434; border-radius: 8px; background: #1f1f1f; }
.ticket-message.staff-message { background: #242424; }
.ticket-message p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-grid textarea, .ticket-reply textarea { display: block; width: 100%; resize: vertical; padding: 10px 12px; background: #111; border: 1px solid #424242; border-radius: 8px; color: inherit; font: inherit; }
.ticket-reply .action-button { margin-top: 10px; }
.ticket-reset-status { margin: 16px 0 0; font-size: 14px; }
@media (min-width: 660px) {
  .profile-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-grid.with-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}
