:root {
  --accent-light: #84dee1;
  --accent-lighter: #c1eff0;
  --accent: teal;
  --accent-dark: #066;
  --accent-darker: #044;
  --button-shadow-light: #0aab;
  --button-shadow-dark: #055b;
  --button-shadow-size: 3px;
  --button-highlight-size: 2px;
  --input-border-width: 2px;
  --font-family: monospace;
}

* {
  box-sizing: border-box;
}

html {
  background-color: black;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  color: white;
  line-height: 1.2;
  font-family: var(--font-family);
  font-size: 1rem;
}

code {
  background-color: var(--accent-darker);
}

h1 {
  font-family: var(--font-family);
}

hr {
  border: none;
  border-top: 2px solid var(--accent-light);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  font-weight: bold;
  white-space: nowrap;
}

td:not(:last-child) {
  padding-right: 0.5rem;
}

thead tr > td, tbody tr:not(:last-child) > td {
  padding-bottom: 0.5rem;
}

td:last-child {
  text-align: right;
}

a {
  color: var(--accent-lighter);
}

a:visited {
  color: var(--accent-light);
}

.header-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  white-space: nowrap;
}

.divider {
  display: flex;
  align-items: center;
  padding: 5px 0;
  gap: 0.5em;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid white;
}
.openid-logo {
  height: 3rem;
  vertical-align: middle;
}

.logo {
  font-family: Arial, sans-serif;
  color: white;
  text-decoration: none;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.1em;
}

.logo:visited {
  color: white;
}

.logo > img {
  width: 1em;
  height: 1em;
}

.honeypot {
  display: none;
}

input {
  font-family: var(--font-family);
}

summary {
  cursor: pointer;
}

input {
  color: white;
  accent-color: var(--accent);
}

input:disabled {
  color: gray;
  filter: grayscale(100%);
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 20em;
  margin: 0.5em 0;
  background-color: black;
  padding: 0.5em;
  border: var(--input-border-width) solid var(--accent);
}

input.long {
  width: 34em;
}

@media (max-width: 600px) {
  input[type="text"]:not([hidden]),
  input[type="number"]:not([hidden]),
  input[type="password"]:not([hidden]),
  input.long:not([hidden]) {
    display: block;
    width: 100%;
  }
}

input[type="number"] {
  width: 5rem;
}

input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled) {
  cursor: pointer;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: white;
  opacity: 0.75;
}

button,
.skin-control,
input[type="submit"],
input[type="file"]::file-selector-button {
  margin: 0.5em var(--button-highlight-size);
  font-family: var(--font-family);
  background-color: var(--accent);
  display: inline-block;
  color: white;
  padding: 0.4em 1em;
  border: none;
  box-shadow:
    0 var(--button-shadow-size) 0 0 var(--button-shadow-light) inset,
    var(--button-shadow-size) 0 0 0 var(--button-shadow-light) inset,
    0 calc(-1 * var(--button-shadow-size)) 0 0 var(--button-shadow-dark) inset,
    calc(-1 * var(--button-shadow-size)) 0 0 0 var(--button-shadow-dark) inset,
    0 0 0 var(--button-highlight-size) black;
}

input[type="file"]::file-selector-button {
  margin-right: 0.5em;
}

button:not(:disabled):hover,
.skin-control:hover,
input[type="submit"]:not(:disabled):hover,
input[type="file"]:not(:disabled)::file-selector-button:hover {
  box-shadow:
    0 var(--button-shadow-size) 0 0 var(--button-shadow-light) inset,
    var(--button-shadow-size) 0 0 0 var(--button-shadow-light) inset,
    0 calc(-1 * var(--button-shadow-size)) 0 0 var(--button-shadow-dark) inset,
    calc(-1 * var(--button-shadow-size)) 0 0 0 var(--button-shadow-dark) inset,
    0 0 0 var(--button-highlight-size) var(--accent-light);
}

button:not(:disabled):active,
.skin-control:active,
input[type="submit"]:not(:disabled):active,
input[type="file"]:not(:disabled)::file-selector-button:active {
  box-shadow:
    0 var(--button-shadow-size) 0 0 var(--button-shadow-dark) inset,
    var(--button-shadow-size) 0 0 0 var(--button-shadow-dark) inset,
    0 calc(-1 * var(--button-shadow-size)) 0 0 var(--button-shadow-light) inset,
    calc(-1 * var(--button-shadow-size)) 0 0 0 var(--button-shadow-light) inset,
    0 0 0 var(--button-highlight-size) var(--accent-light);
}

button:not(:disabled),
.skin-control,
input[type="submit"]:not(:disabled),
input[type="file"]:not(:disabled)::file-selector-button {
  cursor: pointer;
}

select {
  font-family: var(--font-family);
  margin: 0.3em 0;
  background-color: black;
  color: white;
  padding: 0.5em;
  border: none;
  border: var(--input-border-width) solid var(--accent);
}

select:not(:disabled) {
  cursor: pointer;
}

fieldset {
  border: var(--input-border-width) solid var(--accent);
}

.svg-defs {
  width: 0;
  height: 0;
  position: absolute;
}

#background {
  z-index: -1;
  position: fixed;
  inset: 0;
  view-transition-name: background;
}

#content {
  max-width: 800px;
  padding: 1em;
  margin: auto;
}

pre {
  border-left: 2px solid var(--accent-light);
  padding-left: 0.5em;
}

.success-message {
  color: lime;
}

.warning-message {
  color: orange;
}

.error-message {
  color: lightcoral;
}

#skin-container {
  text-align: center;
  position: relative;
  width: fit-content;
  margin: 0 auto;
}

.skin-controls {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  /* Not the CSS model's texel-sized em. */
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

/* Fixed size: a <button>'s and a <label>'s defaults differ. */
.skin-controls button,
.skin-controls .skin-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 1.9rem;
  padding: 0;
  margin: 0;
  user-select: none;
}

/* A mask, not a glyph: a glyph would sit on its font's baseline rather than
   the button's middle. */
.skin-icon {
  width: 0.95rem;
  height: 0.95rem;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.skin-icon-play {
  -webkit-mask-image: url("skin-icon-play.svg");
  mask-image: url("skin-icon-play.svg");
}

.skin-icon-pause {
  -webkit-mask-image: url("skin-icon-pause.svg");
  mask-image: url("skin-icon-pause.svg");
}

.skin-icon-rotate {
  -webkit-mask-image: url("skin-icon-rotate.svg");
  mask-image: url("skin-icon-rotate.svg");
}

.skin-icon-elytra,
.skin-icon-cape {
  width: 1.3rem;
  height: 1.3rem;
}

.skin-icon-elytra {
  -webkit-mask-image: url("skin-icon-elytra.svg");
  mask-image: url("skin-icon-elytra.svg");
}

.skin-icon-cape {
  -webkit-mask-image: url("skin-icon-cape.svg");
  mask-image: url("skin-icon-cape.svg");
}

/* Inline, the canvas sits on a text baseline and descender room pads it. */
#skin-canvas:not([hidden]) {
  display: block;
  margin: 0 auto;
}

.small-texture-preview {
  width: 64px;
  image-rendering: pixelated;
}

.list-profile-picture {
  --list-profile-picture-size: 24px;
  width: var(--list-profile-picture-size);
  height: var(--list-profile-picture-size);
  position: relative;
}

.list-profile-picture-back,
.list-profile-picture-body,
.list-profile-picture-front {
  --texel: calc(var(--list-profile-picture-size) / 8);
  width: 100%;
  height: 100%;
  position: absolute;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-image: var(--list-profile-picture-image);
  background-position-y: calc(-8 * var(--texel));
  background-size: calc(64 * var(--texel));
}

.list-profile-picture-back {
  background-position-x: calc(-56 * var(--texel));
}

.list-profile-picture-body {
  transform: scale(0.92);
  background-position-x: calc(-8 * var(--texel));
}

.list-profile-picture-front {
  background-position-x: calc(-40 * var(--texel));
}

/* Tea Party portal */
:root {
  --accent-light: #f1c77d;
  --accent-lighter: #ffe6b4;
  --accent: #bf7139;
  --accent-dark: #7e4028;
  --accent-darker: #261913;
  --button-shadow-light: #e8a968aa;
  --button-shadow-dark: #6d321faa;
  --font-family: "Segoe UI", Inter, system-ui, sans-serif;
  --tea-surface: rgba(30, 21, 18, 0.94);
  --tea-surface-soft: rgba(50, 33, 27, 0.76);
  --tea-border: rgba(241, 199, 125, 0.2);
  --tea-muted: #c7b8ae;
}

html {
  background:
    radial-gradient(circle at 15% 0%, rgba(126, 64, 40, 0.35), transparent 38rem),
    radial-gradient(circle at 100% 70%, rgba(191, 113, 57, 0.18), transparent 42rem),
    #100c0b;
}

body {
  color: #fff9f1;
  line-height: 1.55;
  background: transparent;
}

#content {
  max-width: 1040px;
  padding: 1.5rem 1.25rem 4rem;
}

.header-nav {
  padding: 0.4rem 0 1.5rem;
}

.header-nav > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-nav a,
.text-link,
.portable-links a,
.back-link a,
.checksums summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.logo {
  font-family: var(--font-family);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.logo > img {
  width: 2rem;
  height: 2rem;
}

a {
  color: var(--accent-lighter);
}

a:visited {
  color: var(--accent-light);
}

h1, h2, h3, h4 {
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  letter-spacing: -0.055em;
  margin: 0.25rem 0 1rem;
}

h2 {
  margin: 0.35rem 0 0.8rem;
}

.hero {
  padding: 3rem 0 2.25rem;
  max-width: 780px;
}

.hero-copy,
.account-hero p {
  color: var(--tea-muted);
  font-size: 1.08rem;
  max-width: 680px;
}

.eyebrow,
.panel-kicker {
  color: var(--accent-light);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 800;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  border: 1px solid var(--tea-border);
  border-radius: 20px;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: linear-gradient(145deg, var(--tea-surface), var(--tea-surface-soft));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.stack-form,
.password-form {
  display: grid;
  gap: 0.75rem;
}

.stack-form label,
.password-form label {
  color: var(--tea-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--tea-border);
  border-radius: 10px;
  background: rgba(8, 6, 5, 0.65);
  padding: 0.78rem 0.9rem;
}

button,
.button,
.skin-control,
input[type="submit"],
input[type="file"]::file-selector-button {
  border-radius: 10px;
  box-shadow: none;
  padding: 0.72rem 1rem;
  font-weight: 750;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

button:not(:disabled):hover,
.button:hover,
.skin-control:hover,
input[type="submit"]:not(:disabled):hover,
input[type="file"]:not(:disabled)::file-selector-button:hover {
  box-shadow: 0 0 0 3px rgba(241, 199, 125, 0.18);
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(135deg, #d9904e, #a95631) !important;
}

.download-list,
.player-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.release-summary {
  color: var(--tea-muted);
  font-size: 0.88rem;
  margin: 0 0 0.85rem;
}

.download-card,
.player-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--tea-border);
  border-radius: 13px;
  color: #fff9f1;
  text-decoration: none;
  background: rgba(8, 6, 5, 0.35);
  transition: 150ms ease;
}

.download-card:visited,
.player-card:visited {
  color: #fff9f1;
}

.download-card:hover,
.player-card:hover {
  border-color: rgba(241, 199, 125, 0.55);
  transform: translateY(-2px);
  background: rgba(126, 64, 40, 0.24);
}

.download-card span:nth-child(2),
.player-card span:nth-child(2) {
  display: grid;
}

.download-card small,
.player-card small,
.steps small {
  color: var(--tea-muted);
}

.platform-icon {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(191, 113, 57, 0.22);
  color: var(--accent-lighter);
  font-size: 1.15rem;
}

.download-arrow {
  color: var(--accent-light);
  font-size: 1.2rem;
}

.text-link {
  font-size: 0.88rem;
}

.portable-links {
  color: var(--tea-muted);
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
}

.checksums {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--tea-muted);
}

.checksums summary {
  cursor: pointer;
  color: var(--accent-lighter);
}

.checksums code,
.checksums small {
  display: block;
  margin-top: 0.45rem;
}

.checksums code {
  max-width: 100%;
  padding: 0.45rem;
  overflow-wrap: anywhere;
  color: #f8dfba;
}

.steps-panel {
  margin-top: 1rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}

.steps > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
}

.steps b {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
}

.steps span {
  display: grid;
}

.muted,
.security-note,
.page-intro {
  color: var(--tea-muted);
}

.security-note,
.page-intro {
  text-align: center;
  font-size: 0.86rem;
  margin-top: 1.25rem;
}

.account-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 0 1.75rem;
}

.account-hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.5rem);
}

.status-pill {
  white-space: nowrap;
  border: 1px solid rgba(113, 211, 150, 0.28);
  background: rgba(38, 118, 70, 0.16);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  color: #baf4cf;
  font-size: 0.82rem;
}

.status-pill i {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #6fe29a;
  margin-right: 0.35rem;
}

.large-avatar {
  --list-profile-picture-size: 42px;
}

.security-panel {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.8fr);
  gap: 2rem;
  align-items: center;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(241, 199, 125, 0.7);
  outline-offset: 3px;
}

.registration-grid,
.appearance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 1rem;
  align-items: start;
}

.registration-hero {
  padding-bottom: 1.25rem;
}

.invite-required {
  color: #ffd49a;
  border-color: rgba(241, 199, 125, 0.28);
  background: rgba(191, 113, 57, 0.14);
}

.locked-panel {
  max-width: 680px;
  margin: 1rem auto 0;
  text-align: center;
}

.stack-form label small,
.texture-upload small {
  display: block;
  margin-top: -0.25rem;
  color: var(--tea-muted);
  font-weight: 400;
}

.form-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
}

.numbered-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  gap: 1rem;
  counter-reset: registration-step;
}

.numbered-list li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  column-gap: 0.7rem;
  counter-increment: registration-step;
}

.numbered-list li::before {
  content: counter(registration-step);
  grid-row: span 2;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff9f1;
  background: var(--accent);
  font-weight: 800;
}

.numbered-list span {
  color: var(--tea-muted);
  font-size: 0.85rem;
}

.back-link {
  margin: 0.75rem 0 0;
}

.back-link a {
  text-decoration: none;
}

.appearance-header {
  padding: 2rem 0 1.5rem;
}

.appearance-header h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
}

.appearance-header p {
  color: var(--tea-muted);
}

.preview-panel {
  position: sticky;
  top: 1rem;
}

.preview-hint {
  margin: 1rem auto 0;
  max-width: 24rem;
  text-align: center;
  font-size: 0.82rem;
}

.appearance-settings h2 {
  font-size: 1.35rem;
}

.texture-upload {
  display: grid;
  gap: 0.55rem;
}

.texture-upload input[type="file"] {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem;
  border: 1px dashed var(--tea-border);
  border-radius: 10px;
  color: var(--tea-muted);
  background: rgba(8, 6, 5, 0.35);
}

.current-texture {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(8, 6, 5, 0.3);
  color: var(--tea-muted);
}

.current-texture img {
  border-radius: 6px;
}

.delete-texture {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--tea-muted);
  font-size: 0.85rem;
}

.model-choice {
  padding: 0.85rem;
  border: 1px solid var(--tea-border);
  border-radius: 10px;
}

.model-choice label {
  margin-right: 0.8rem;
}

.save-appearance {
  margin: 1.25rem 0 0;
}

.save-appearance input {
  width: 100%;
}

.error-page {
  max-width: 680px;
  margin: 3rem auto;
  text-align: center;
}

.error-page h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.error-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.admin-hero {
  padding-bottom: 1.25rem;
}

.admin-section + .admin-section {
  margin-top: 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.admin-section h2 {
  margin-bottom: 0.25rem;
}

.inline-action {
  flex: 0 0 auto;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--tea-border);
  border-radius: 12px;
}

.admin-table {
  min-width: 680px;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--tea-border);
}

.admin-table th {
  color: var(--tea-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: rgba(241, 199, 125, 0.035);
}

.invite-table {
  table-layout: fixed;
}

.invite-table th:first-child {
  width: 58%;
}

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.invite-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-invite,
.danger-button {
  padding: 0.5rem 0.7rem;
  min-height: 36px;
  font-size: 0.76rem;
}

.danger-button {
  border-color: rgba(255, 135, 120, 0.35);
  color: #ffc0b8;
  background: rgba(126, 38, 31, 0.18);
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--tea-border);
  border-radius: 12px;
  color: var(--tea-muted);
  text-align: center;
}

.users-table input[type="number"] {
  width: 6rem;
}

.users-table input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.admin-save {
  display: flex;
  justify-content: flex-end;
  margin: 1rem 0 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .portal-grid,
  .steps,
  .security-panel,
  .registration-grid,
  .appearance-grid {
    grid-template-columns: 1fr;
  }

  .account-hero {
    align-items: start;
    flex-direction: column;
  }

  .header-nav {
    align-items: flex-start;
    white-space: normal;
  }

  .header-nav > div:last-child {
    align-items: flex-end;
    flex-direction: column;
  }

  .preview-panel {
    position: static;
  }

  .panel {
    border-radius: 16px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading input[type="submit"] {
    width: 100%;
  }

  .admin-save input[type="submit"] {
    width: 100%;
  }
}

@media (max-width: 440px) {
  #content {
    padding-inline: 0.85rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .header-nav > div:last-child {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
