:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --cream: #fff2c7;
  --deep: #132f2c;
  --glass: rgba(15, 39, 36, 0.86);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--deep); }
body { color: var(--cream); }
button, input { font: inherit; }
button { color: inherit; }

#world {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
#labels {
  position: fixed; z-index: 4; inset: 0; width: 100%; height: 100%; display: block;
  pointer-events: none;
}

.hud {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; padding: 15px 18px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.brand { color: var(--cream); text-decoration: none; font-family: Georgia, serif; font-size: 18px; text-shadow: 2px 2px 0 rgba(15,37,34,.38); }
.brand span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 7px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(16,44,40,.5); }
.hud-actions { display: flex; align-items: center; gap: 7px; }
.presence, .icon-button {
  height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px;
  background: rgba(17,45,41,.72); box-shadow: 3px 3px 0 rgba(10,28,26,.2); backdrop-filter: blur(8px);
}
.presence { display: flex; align-items: center; gap: 6px; padding: 0 11px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.presence i { width: 6px; height: 6px; border-radius: 1px; background: #ce765f; }
.presence i.online { background: #b9d66e; box-shadow: 0 0 8px #b9d66e; }
.icon-button { width: 36px; padding: 0; cursor: pointer; font-size: 17px; }
.icon-button:hover, .icon-button.active { background: rgba(46,79,67,.9); }
.icon-button.muted { opacity: .48; text-decoration: line-through; }

.welcome {
  position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px;
  background: rgba(9,29,27,.3); backdrop-filter: blur(4px);
  transition: opacity .25s steps(4), visibility .25s;
}
.welcome.dismissed { opacity: 0; visibility: hidden; }
.creator-card {
  width: min(380px, 100%); padding: 26px; border: 2px solid rgba(255,242,199,.42); border-radius: 4px;
  background: var(--glass); box-shadow: 9px 9px 0 rgba(7,27,24,.34);
}
.creator-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.creator-copy p { margin: 0; color: #b8d57c; font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font: 25px/1 Georgia, serif; letter-spacing: -.025em; }
#avatarPreview { display: block; width: 136px; height: 136px; margin: 12px auto 10px; image-rendering: pixelated; }
.name-field span, legend { display: block; margin-bottom: 6px; color: rgba(255,242,199,.58); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
#nameInput { width: 100%; height: 42px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 3px; outline: 0; background: rgba(5,25,23,.46); color: white; }
#nameInput:focus { border-color: #b8d57c; }
fieldset { margin: 15px 0 0; padding: 0; border: 0; }
.coat-picker, .path-picker { display: grid; gap: 6px; }
.coat-picker { grid-template-columns: repeat(4, 1fr); }
.coat-picker legend, .path-picker legend { grid-column: 1 / -1; }
.coat-picker input, .path-picker input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span, .path-picker label span { display: flex; align-items: center; justify-content: center; min-height: 35px; border: 1px solid rgba(255,255,255,.12); border-radius: 3px; cursor: pointer; font-size: 9px; }
.swatch span::before { content: ""; width: 8px; height: 8px; margin-right: 5px; background: #617f49; box-shadow: 1px 1px 0 #253b2d; }
.swatch.berry span::before { background: #ad4d50; }.swatch.sky span::before { background: #4188ae; }.swatch.sun span::before { background: #d79b24; }
.swatch input:checked + span, .path-picker input:checked + span { border-color: #eaf0b5; background: rgba(234,240,181,.11); color: white; }
.path-picker { grid-template-columns: repeat(3, 1fr); }
.path-picker label span { flex-direction: column; gap: 3px; min-height: 48px; }
.path-picker b { color: #b8d57c; font-size: 15px; line-height: 1; }
.play-button { width: 100%; display: flex; justify-content: space-between; margin-top: 18px; padding: 13px 15px; border: 0; border-radius: 3px; cursor: pointer; background: #e7edaf; color: #173a34; font-weight: 900; box-shadow: 3px 3px 0 #759461; }
.play-button:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #759461; }
.creator-card > small { display: block; margin-top: 12px; text-align: center; color: rgba(255,242,199,.38); font-size: 8px; }

.chat { position: fixed; z-index: 12; left: 50%; bottom: 22px; width: min(390px, calc(100% - 36px)); transform: translateX(-50%); display: flex; padding: 5px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: rgba(10,34,31,.9); box-shadow: 5px 5px 0 rgba(8,25,23,.28); }
.chat[hidden] { display: none; }
.chat input { min-width: 0; flex: 1; padding: 9px 10px; border: 0; outline: 0; background: transparent; color: white; }
.chat button { width: 36px; border: 0; border-radius: 2px; background: #e7edaf; color: #173a34; cursor: pointer; font-weight: 900; }
.hint { position: fixed; z-index: 9; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; padding: 7px 10px; border-radius: 3px; background: rgba(12,35,32,.56); color: rgba(255,242,199,.7); font-size: 8px; white-space: nowrap; transition: opacity .6s; }
.hint.faded { opacity: 0; }
.toast { position: fixed; z-index: 30; left: 50%; top: 64px; transform: translate(-50%,-6px); padding: 8px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 3px; background: rgba(10,31,29,.9); font-size: 9px; opacity: 0; pointer-events: none; transition: .16s steps(2); }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 520px) {
  .hud { padding: 11px; }
  .brand { font-size: 15px; }
  .brand span { width: 25px; height: 25px; }
  .presence { display: none; }
  .creator-card { padding: 21px; }
  .creator-copy { display: block; }
  .creator-copy p { margin-bottom: 6px; }
  .hint { bottom: 12px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
}
