:root {
  --ground: #12202b;
  --panel: #1b2f3d;
  --panel2: #213a4b;
  --line: #33566b;
  --fur: #8a5a3b;
  --bill: #f0a24b;
  --bill-dk: #c77f2e;
  --aqua: #38b6c4;
  --cream: #f3ead9;
  --muted: #94a9b6;
  --gold: #ffcf4d;
  --silver: #c9d2d8;
  --shadow: #0a141b;
  --danger: #e6604f;
  --radius: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--cream);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(56, 182, 196, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 182, 196, .04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.mono, .wordmark, h1, h2, button, .button {
  font-family: ui-monospace, "Courier New", monospace;
}

canvas { image-rendering: pixelated; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.9rem 1.25rem;
  background: var(--ground);
  border-bottom: 3px solid var(--line);
}

.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  color: var(--cream);
}
.wordmark b { color: var(--bill); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-left: auto;
  font-family: ui-monospace, "Courier New", monospace;
}

.lang-toggle a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.4rem;
}

.lang-toggle a.active {
  color: var(--cream);
  border-bottom: 2px solid var(--bill);
}

.lang-sep { color: var(--line); }

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  color: var(--muted);
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.72rem;
}
.site-footer a { color: var(--aqua); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--cream); text-decoration: underline; }

.card {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.poster-preview {
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.1rem;
  color: var(--cream);
  background: var(--panel);
  border: 3px solid var(--aqua);
  box-shadow: 7px 7px 0 var(--shadow);
}
.poster-preview::backdrop { background: rgba(10, 20, 27, .8); }
.poster-preview-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.poster-preview-head h2 { margin-bottom: .25rem; }
.poster-preview-head .hint { margin: 0; }
.poster-preview-image { margin: 1rem 0; border: 3px solid var(--line); background: var(--ground); }
.poster-preview-image canvas { width: 100%; height: auto; }
.poster-preview-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }

h1 { font-size: 1.35rem; margin: 0 0 0.85rem; letter-spacing: 0.5px; text-transform: lowercase; }
h2 { font-size: 0.85rem; margin: 0 0 0.85rem; letter-spacing: 2px; text-transform: uppercase; color: var(--aqua); }

.muted { color: var(--muted); font-size: 0.92rem; }
.hint { color: var(--muted); font-size: 0.85rem; }

label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 3px solid var(--line);
  background: var(--panel2);
  color: var(--cream);
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--bill);
}

input:focus-visible, textarea:focus-visible, button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}

textarea { resize: vertical; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--cream);
  font-size: 0.95rem;
}
.checkbox-row input { width: auto; }

.preset-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

button, .button {
  cursor: pointer;
  border: 3px solid var(--shadow);
  padding: 0.8rem 1.1rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--panel2);
  color: var(--cream);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.04s, box-shadow 0.04s;
}

button:active, .button:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--shadow); }

button.preset {
  flex: 1;
  padding: 0.55rem;
  min-height: auto;
  box-shadow: 3px 3px 0 var(--shadow);
}
button.preset:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow); }

button.primary, .button.primary {
  background: var(--bill);
  color: var(--ground);
}
button.primary:disabled, .button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
button:disabled, .button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

button.secondary { background: var(--panel2); border-color: var(--line); color: var(--cream); }

button.danger {
  background: var(--danger);
  color: var(--ground);
}

/* Full-width submit buttons. Scoped to actual submit buttons -- NOT every
   button inside .add-song-form, which used to bleed width:100% into the
   search-row and per-result 'add' buttons and collapse their neighbors. */
form button[type="submit"] {
  margin-top: 1.1rem;
  width: 100%;
}

/* Avatar picker ---------------------------------------------------- */
.avatar-picker { margin: 1rem 0; }
.avatar-picker-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.avatar-picker-preview canvas {
  border-radius: 50%;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
}
.avatar-swatch-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.avatar-swatch-row .avatar-swatch-label {
  width: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.avatar-swatch {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--shadow);
  box-shadow: none;
}
.avatar-swatch.selected { border-color: var(--cream); box-shadow: 0 0 0 2px var(--bill); }
.avatar-swatch:active { transform: none; box-shadow: 0 0 0 2px var(--bill); }
button.avatar-random-btn { margin-top: 0.4rem; }

/* Body-shape picker (buttons injected by avatar.js). */
.avatar-shapes { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; margin: 0 0 0.7rem; }
.avatar-shape {
  width: 46px; height: 46px; min-height: 0; padding: 3px;
  border-radius: 10px; border: 2px solid var(--line);
  background: transparent; box-shadow: none; line-height: 0; cursor: pointer;
}
.avatar-shape.selected { border-color: var(--bill); box-shadow: 0 0 0 2px var(--bill); }
.avatar-shape:active { transform: none; box-shadow: 0 0 0 2px var(--bill); }
.avatar-shape canvas { width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated; display: block; }

.flash {
  list-style: none;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.1rem;
  background: #2a1f12;
  border: 3px solid var(--bill-dk);
  box-shadow: 6px 6px 0 var(--shadow);
  color: var(--bill);
}
.flash li + li { margin-top: 0.4rem; }

.countdown {
  display: inline-block;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ground);
  background: var(--aqua);
  padding: 0.3rem 0.75rem;
}

.ranking-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel2);
  border: 3px solid var(--line);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.6rem;
  /* none (not pan-y): pan-y would lock the gesture to native scroll at
     touch-start, so a long-press-then-drag can't take over and the page
     scrolls instead. We handle pre-drag scrolling manually in app.js. */
  touch-action: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* Long-press to drag must not select the title/artist text or pop the
     iOS text callout. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ranking-item.dragging {
  opacity: 0.95;
  border-color: var(--bill);
  box-shadow: 6px 6px 0 var(--shadow);
  transform: scale(1.02);
  position: relative;
  z-index: 10;                 /* float above the rows it passes over */
  will-change: transform;
}

.rank-num {
  flex: none;
  min-width: 2.2rem;
  text-align: center;
  font-family: ui-monospace, "Courier New", monospace;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--cream);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.ranking-item:nth-child(1) .rank-num { color: var(--gold); }
.ranking-item:nth-child(2) .rank-num { color: var(--silver); }
.ranking-item:nth-child(3) .rank-num { color: var(--bill-dk); }

.drag-handle {
  cursor: grab;
  color: var(--muted);
  padding: 0.3rem 0.1rem;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.rank-num:active,
.drag-handle:active {
  cursor: grabbing;
}

.song-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.song-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
}

/* Row context menu (long-press then release without dragging). */
.row-menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.row-menu {
  position: fixed;
  z-index: 41;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  min-width: 9.5rem;
  padding: 0.3rem;
}
.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  box-shadow: none;
  min-height: 0;
  padding: 0.7rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--cream);
}
.row-menu-item:hover, .row-menu-item:active {
  background: var(--panel2);
  transform: none;
  box-shadow: none;
}

.song-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rank-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}

.rank-buttons button {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1;
  min-height: auto;
  box-shadow: 2px 2px 0 var(--shadow);
}
.rank-buttons button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }

.save-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
}

.save-status {
  font-family: ui-monospace, "Courier New", monospace;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--panel2);
  border: 2px solid var(--line);
  padding: 0.3rem 0.7rem;
}

/* Empty status (e.g. the share button before it's clicked) shouldn't render
   as a stray bordered box. */
.save-status:empty {
  display: none;
}

.add-song-form {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 3px solid var(--line);
}

.share-box {
  background: var(--panel2);
  border: 3px solid var(--line);
  padding: 0.9rem;
  margin-bottom: 1.1rem;
}
.share-box label { margin-top: 0.6rem; }
.copy-row input { font-size: 0.85rem; }

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.standings th, table.standings td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 2px solid var(--line);
}
table.standings th {
  color: var(--aqua);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: ui-monospace, "Courier New", monospace;
}

.setlist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.setlist li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.6rem;
  border-bottom: 2px solid var(--line);
  overflow: hidden;
}
.setlist li::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: calc(var(--pct, 0) * 1%);
  background: var(--bill);
}
.setlist li:first-child { background: var(--panel2); }
.setlist-rank {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, "Courier New", monospace;
  font-weight: 700;
  color: var(--cream);
  background: var(--ground);
  border: 2px solid var(--line);
}
.setlist li:nth-child(1) .setlist-rank { background: var(--gold); color: var(--ground); border-color: var(--bill-dk); }
.setlist li:nth-child(2) .setlist-rank { background: var(--silver); color: var(--ground); }
.setlist li:nth-child(3) .setlist-rank { background: var(--bill-dk); color: var(--ground); }
.setlist-title { font-weight: 600; }
.setlist-meta {
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}

.song-thumb {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}

.preview-btn {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bill);
  border: 2px solid var(--shadow);
  color: var(--ground);
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--shadow);
}
.preview-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow); }

.setlist .preview-btn { margin-left: auto; }

/* --------------------------------------------------------------------
   YouTube search picker
   -------------------------------------------------------------------- */
.link-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--aqua);
  padding: 0.4rem 0;
  min-height: auto;
  font-size: 0.88rem;
  text-decoration: underline;
  text-transform: none;
  letter-spacing: normal;
}
.link-btn:active { transform: none; }

.yt-search-box { margin-top: 0.6rem; }

.yt-search-row {
  display: flex;
  gap: 0.5rem;
}
.yt-search-row input { flex: 1; min-width: 0; }
/* Override the `.add-song-form button { width:100% }` rule for the search-row
   buttons -- otherwise they each demand full width and overflow the row,
   squishing the input to a sliver. */
.yt-search-row button { flex-shrink: 0; min-width: auto; width: auto; margin-top: 0; }

.yt-search-results {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
}

.yt-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--panel2);
  border: 2px solid var(--line);
}

.yt-result-thumb {
  width: 4.5rem;
  height: 2.5rem;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ground);
  border: 2px solid var(--line);
}

.yt-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.yt-result-title { font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.yt-result-channel { color: var(--muted); font-size: 0.8rem; }

.yt-result-add {
  flex-shrink: 0;
  min-height: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
}

.yt-search-message {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.5rem 0.1rem;
}

.manual-add-form { margin-top: 0.8rem; }
.manual-add-form[hidden] { display: none; }

.picked-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.8rem 0 0.3rem;
}

.picked-list {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
}

/* --------------------------------------------------------------------
   Manage: staged song removal (R1) + add feedback (R3)
   -------------------------------------------------------------------- */
.song-manage-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}
.song-manage-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid var(--line);
}
.mg-song-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mg-remove-hint { font-size: 0.8rem; }
.mg-remove-pending .mg-song-label { text-decoration: line-through; color: var(--muted); }

.yt-result-added { opacity: 0.7; }
.yt-result-add[disabled] { opacity: 0.6; cursor: default; }

.picked-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--panel2);
  border: 2px solid var(--line);
}

/* --------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.heromascot { margin: 0 auto 0.5rem; width: max-content; }

.hero-brand {
  font-size: clamp(1.9rem, 7vw, 2.7rem);
  margin: 0.5rem 0 0.5rem;
  letter-spacing: 1px;
  text-transform: lowercase;
  color: var(--cream);
}
.hero-brand b { color: var(--bill); }

.hero-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 auto 1.75rem;
  max-width: 32ch;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hero-btn {
  padding: 1.1rem 1.25rem;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.hero-btn.make { background: var(--bill); color: var(--ground); }
.hero-btn.join { background: var(--aqua); color: var(--ground); }

.hero-btn-title { font-size: 1.05rem; font-weight: 700; }
.hero-btn-sub { font-size: 0.8rem; opacity: 0.85; text-transform: none; letter-spacing: normal; font-weight: 400; }

.ripple {
  margin-top: 1.75rem;
  width: 100%;
  height: 14px;
  background: repeating-linear-gradient(90deg, var(--aqua) 0 8px, transparent 8px 16px);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 16px);
          mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 16px);
  opacity: 0.5;
}

.hero-how { text-align: center; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; gap: 10px; } }

.step { text-align: center; padding: 16px 10px; }
.step canvas { margin: 0 auto 8px; }
.step .n {
  font-family: ui-monospace, "Courier New", monospace;
  color: var(--bill);
  font-size: 0.7rem;
  letter-spacing: 1px;
}
.step p { margin: 4px 0 0; font-size: 0.9rem; }

.hero-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.hero-steps li {
  counter-increment: step;
  color: var(--muted);
}

.hero-steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.5rem;
  background: var(--ground);
  border: 2px solid var(--line);
  color: var(--bill);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Session landing hub (Phase 2) -------------------------------------- */
.hub-actions { margin: 1rem 0; }
.hub-actions .button { width: 100%; }

.avatar-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.9rem;
}
.avatar-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}
.avatar-grid-item canvas {
  border-radius: 50%;
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--shadow);
}
.avatar-grid-name {
  font-size: 0.78rem;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.landing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.landing-header-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.landing-header-title h1 { margin: 0; }
.landing-countdown { flex-shrink: 0; }

.host-manage-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}
.host-manage-link:hover { color: var(--aqua); text-decoration: underline; }

.status-pill {
  display: inline-block;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 2px solid var(--shadow);
}
.status-pill-open { background: var(--aqua); color: var(--ground); }
.status-pill-closed { background: var(--line); color: var(--cream); }

.me-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.me-avatar-btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  cursor: pointer;
}
.me-avatar-btn canvas,
.me-placeholder {
  border-radius: 50%;
  border: 4px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
}
.me-nickname {
  margin: 0.75rem 0 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.me-card .hub-actions { width: 100%; max-width: 22rem; }
.me-avatar-editor[hidden] { display: none; }
.me-avatar-editor { margin-top: 1.1rem; width: 100%; text-align: left; }

/* Enter page: join/login tabs (Phase 3) --------------------------- */
.enter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.enter-tab {
  flex: 1;
  background: var(--panel2);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}
.enter-tab.active {
  background: var(--bill);
  border-color: var(--shadow);
  color: var(--ground);
}
.enter-pane[hidden] { display: none; }

.member-select {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: var(--panel2);
  border: 3px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  box-shadow: none;
}
.member-row canvas {
  border-radius: 50%;
  border: 2px solid var(--line);
  flex: none;
}
.member-row-name { flex: 1; overflow-wrap: anywhere; }
.member-row-check { color: var(--aqua); font-size: 0.85rem; display: none; }
.member-row.selected {
  border-color: var(--bill);
  box-shadow: 3px 3px 0 var(--shadow);
}
.member-row.selected .member-row-check { display: inline; }

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  font-family: ui-monospace, "Courier New", monospace;
}
.back-link:hover { color: var(--cream); }

@media (min-width: 560px) {
  .hero-actions { flex-direction: row; }
  .hero-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 480px) {
  .content { padding: 0.7rem 0.55rem 3rem; }
  .card { padding: 0.8rem; }
  /* Tighter rows on phones so long titles get more room. */
  .ranking-item { padding: 0.5rem 0.45rem; gap: 0.4rem; }
  .yt-result { padding: 0.4rem; gap: 0.45rem; }
}
