/* community.css: the lobby, the live feed, BEST FIT OTD, the shared goal. Square corners, thin black lines, no soft shadows. */

/* -- the live feed: a thin strip at the top of the home page and of the lobby -- */
.ticker {
  position: relative;
  flex: none;
  width: 100%;
  min-height: 1.75rem;
  padding: 0 var(--gutter-right) 0 var(--gutter-left);
  border-bottom: 1px solid var(--color-ink);
  overflow: hidden;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.625rem;
  line-height: 1.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ticker span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: no-preference) {
  .ticker span.is-new {
    animation: ticker-in 0.4s ease-out;
  }
}

@keyframes ticker-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

.home > .ticker {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-paper);
}

/* -- the shared goal -- */
.goal p {
  font-size: var(--text-small);
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.goal-bar {
  height: 1px;
  margin-top: var(--space-2);
  background: var(--color-line);
}

.goal-bar i {
  display: block;
  height: 3px;
  margin-top: -1px;
  background: var(--color-ink);
}

/* -- the flat avatar, dressed -- */
.fig {
  position: relative;
  height: 100%;
}

.fig img {
  position: absolute;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.fig .fig-base {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* -- the lobby: a lookbook of players -- */
.lobby {
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.lobby-head {
  flex: none;
  padding: var(--space-2) var(--gutter-right) var(--space-2) var(--gutter-left);
}

.lobby-head .hand {
  font-size: 1.9rem;
  text-align: left;
}

.online {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
  letter-spacing: 0.1em;
}

.online b {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.dot-online {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #2fcf5a;
}

@media (prefers-reduced-motion: no-preference) {
  .online .dot-online {
    animation: pulse 1.6s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(1.5);
  }
}

.lobby-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--gutter-right) var(--space-3) var(--gutter-left);
}

.look-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-2);
  list-style: none;
}

.look-frame,
.player-big {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  background: linear-gradient(180deg, #f1f0ee 0%, #f1f0ee 68%, #dcdbd9 68%, #e6e5e3 100%);
  box-shadow: none;
}

.player-big {
  aspect-ratio: 3 / 4;
  max-height: 52cqh;
  margin: 0 auto;
}

/* the soft shadow under the feet */
.look-floor {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 4%;
  height: 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(0 0 0 / 0.28), transparent 70%);
}

.look-frame .snap,
.player-big .snap {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: auto;
  height: 94%;
  transform: translateX(-50%);
}

.look-u {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  padding: 0 0.4rem;
  background: var(--color-ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.625rem;
  line-height: 1.1rem;
  color: var(--color-paper);
}

.look-cap {
  margin-top: var(--space-1);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.5625rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.look-cap b {
  font-weight: 400;
}

.look-cap span {
  display: block;
  color: var(--color-ink-soft);
}

.lobby-banner {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - var(--gutter-left) - var(--gutter-right));
  min-height: var(--tap-target);
  margin: var(--space-2) var(--gutter-right) 0 var(--gutter-left);
  padding: 0;
  border: 0;
  border-top: 1px solid var(--color-ink);
  border-bottom: 1px solid var(--color-ink);
  border-radius: 0;
  background: none;
  font-size: var(--text-small);
  letter-spacing: 0.14em;
  color: var(--color-ink);
}

.phone:not(.no-tabs) .lobby-banner {
  margin-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
}

/* -- the player sheet -- */
.player-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.player-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
  letter-spacing: 0.1em;
}

.player-head span:last-child {
  margin-left: auto;
}

.player-head b {
  font-weight: 400;
}

.player-pieces {
  list-style: none;
  border-top: 1px solid var(--color-ink);
}

.player-pieces li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-line);
  font-size: var(--text-small);
  letter-spacing: 0.08em;
}

.player-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.player-actions .button {
  border-radius: 0;
}

.send-list {
  list-style: none;
}

.send-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 3.5rem;
  padding: var(--space-1) 0;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  background: none;
  font-size: var(--text-small);
  letter-spacing: 0.06em;
  text-align: left;
  color: var(--color-ink);
}

.send-item img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.send-item em {
  font-style: normal;
}

/* -- BEST FIT OTD -- */
.bestfit .screen-body > * + * {
  margin-top: var(--space-3);
}

.bf-title {
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-align: left;
}

.bf-label {
  font-size: var(--text-micro);
  letter-spacing: 0.2em;
  color: var(--color-ink-soft);
}

.bf-lead {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-ink);
}

.bf-lead .fig {
  width: 5rem;
  height: 9rem;
  aspect-ratio: auto !important;
  flex: none;
}

.bf-lead b,
.bf-lead span {
  display: block;
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.1em;
}

.bf-lead span {
  color: var(--color-ink-soft);
}

.bestfit .button {
  border-radius: 0;
}

.bf-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-3);
  list-style: none;
}

.bf-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bf-photo {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--color-ink);
  background-position: center;
  background-size: cover;
}

.bf-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 0.35);
}

.bf-photo .fig {
  position: absolute;
  left: 50%;
  bottom: 4%;
  height: 88%;
  width: auto;
  transform: translateX(-50%);
}

.bf-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bf-info b {
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.bf-info span {
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  color: var(--color-ink-soft);
}

.look-visual {
  position: relative;
  width: 100%;
}

.bf-vote {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  min-height: var(--tap-target);
  margin: 0;
  padding: var(--space-1);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-round);
  background: var(--color-paper);
  font-size: var(--text-micro);
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-ink);
}

.bf-vote svg {
  width: var(--space-3);
  height: var(--space-3);
  margin-bottom: var(--space-1);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
}

.bf-vote[aria-pressed='true'] {
  background: var(--color-ink);
  color: var(--color-paper);
}

.bf-vote[aria-pressed='true'] svg {
  fill: currentColor;
}

/* -- the winner -- */
.winner .screen-body > * + * {
  margin-top: var(--space-3);
}

.win-card {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 60cqh;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--color-ink);
  background-position: center;
  background-size: cover;
}

.win-card .fig {
  position: absolute;
  left: 50%;
  bottom: 4%;
  height: 90%;
  transform: translateX(-50%);
}

.win-line {
  font-size: var(--text-large);
  letter-spacing: 0.14em;
  text-align: center;
}

.blog-preview {
  border-top: 1px solid var(--color-ink);
  padding-top: var(--space-3);
}

.blog-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.blog-photo .fig {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 96%;
  transform: translateX(-50%);
}

.blog-meta {
  margin-top: var(--space-2);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  color: var(--color-ink-soft);
}

.blog-preview h2 {
  margin-top: var(--space-1);
  font-size: var(--text-large);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.blog-text {
  margin-top: var(--space-2);
  font-size: var(--text-small);
  line-height: 1.5;
}

.winner .button {
  width: 100%;
  border-radius: 0;
}

/* -- POST UR FIT, and SHARE -- */
.post-fit {
  position: absolute;
  top: var(--space-2);
  right: var(--gutter-right);
}

.reveal-share {
  align-self: center;
}

/* the 3D snapshot of a dressed avatar */
.snap {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  pointer-events: none;
}

.lobby-player .snap,
.lobby-me .snap {
  position: absolute;
  inset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .lobby-player .snap {
    transform-origin: 50% 100%;
    animation: sway 5s ease-in-out infinite;
    animation-delay: var(--d, 0s);
  }
}

.bf-photo .snap,
.win-card .snap,
.blog-photo .snap {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: auto;
  height: 88%;
  transform: translateX(-50%);
}

.bf-lead .snap {
  width: 5rem;
  height: 9rem;
  flex: none;
}

.sheet-player {
  max-height: 100%;
  height: 100%;
  border-radius: 0;
}

.player-pieces li {
  display: flex;
  justify-content: space-between;
}

.player-pieces em {
  font-style: normal;
}

.player-total {
  border-bottom: 1px solid var(--color-ink) !important;
}

.player-actions .button-primary {
  background: var(--color-ink);
  color: var(--color-paper);
}

/* the round tab bubble rises above the bar: leave it room, the banner does not sit under it */
.phone:not(.no-tabs) .lobby-banner {
  margin-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 2.4rem);
}



.bf-hint {
  margin-top: var(--space-1);
  text-align: left;
  font-size: var(--text-micro);
}

.bf-frame {
  cursor: default;
}

.bestfit {
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.lobby-timer {
  margin-top: var(--space-1);
  color: var(--color-ink-soft);
}

/* every card of a row has the same height: the vote buttons line up whatever the length of the caption */
.look-grid {
  align-items: stretch;
}

.look {
  display: flex;
  flex-direction: column;
}

.look-cap {
  flex: 1;
  min-height: 3.6em;
}

.lobby-head {
  padding-bottom: var(--space-2);
}

.lobby-timer {
  margin-top: var(--space-1);
  font-size: var(--text-small);
}

.lobby-scroll {
  padding-top: var(--space-1);
}

.lobby-scroll {
  padding-bottom: calc(var(--tabbar-height) + var(--space-5));
}

/* -- the winner: calmer spacing, round buttons like the other pages -- */
.winner .hand-small {
  margin-top: calc(var(--space-2) * -1);
}

.winner .win-line {
  padding-bottom: var(--space-2);
}

.winner .blog-text {
  margin-bottom: var(--space-4);
}

.winner .button {
  border-radius: 999px;
  min-height: 3.25rem;
  margin-top: var(--space-3);
}

.winner .button + .button {
  margin-top: var(--space-2);
}

.winner .text-button {
  display: block;
  margin: var(--space-4) auto 0;
}

.winner .screen-body {
  padding-bottom: calc(var(--tabbar-height) + var(--space-5));
}

.look-frame.is-me {
  outline: 3px solid var(--color-ink);
  outline-offset: 3px;
}

/* Keep every action reachable when the phone's browser bars reduce the height. */
.winner .screen-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding-bottom: calc(var(--tabbar-height) + var(--space-2));
  overflow-y: auto;
}

.winner .screen-body > * {
  flex-shrink: 0;
}

.winner .screen-body > * + * {
  margin-top: var(--space-2);
}

.winner .hand.big {
  font-size: 2.6rem;
  line-height: 1;
}

.winner [data-winner-body] {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: var(--space-2);
  flex: none;
}

.winner [data-winner-body] > * {
  flex-shrink: 0;
}

.winner .win-card {
  height: 40cqh;
  max-width: 100%;
  max-height: none;
  flex: none;
}

.winner .win-line {
  font-size: var(--text-body);
  padding: 0;
}

.winner .button {
  min-height: 3rem;
  margin-top: 0;
}

.winner .button + .button {
  margin-top: 0;
}

.winner .text-button {
  margin-top: var(--space-1);
}

/* more air between the cards; the outline of your own frame is thin and leaves room */
.look-grid {
  gap: var(--space-4) var(--space-3);
}

.look-frame.is-me {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

.look-cap {
  margin-top: var(--space-2);
  line-height: 1.55;
}

.tile.is-received {
  box-shadow: 0 0 0 3px var(--color-paper), 0 0 0 6px var(--color-ink);
}

/* The hidden title shows no frame. */
.look-cap {
  flex: 0 0 auto;
}

.look {
  justify-content: space-between;
}

.lobby-head .visually-hidden:focus-visible + * {
  outline: none;
}

/* rounded frames in the lobby */
.look-frame {
  border-radius: 25px;
  overflow: hidden;
}

.look-frame.is-me {
  outline-offset: 3px;
}

.look-u {
  border-radius: 999px;
}

/* the lobby card: the photo, the id next to the number, the vote. Nothing else. */
.look-frame {
  border-radius: 36px;
}

.look-u {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  top: 0.65rem;
  left: 0.65rem;
  max-width: calc(100% - 1.3rem);
  padding: 0 0.7rem 0 0.2rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.look-u b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--color-paper);
  color: var(--color-ink);
  font-weight: 400;
}

.look-frame {
  border-radius: 24px;
}

/* the avatar stays under the name pill: it never touches it */
.look-frame:not(.look-big) .snap {
  height: 78%;
  bottom: 4%;
}

.look-frame {
  border-radius: 14px;
}

/* one design everywhere: every button is a pill, every picture frame has the same corner as the cards */
html .button,
html .winner .button,
html .player-actions .button {
  border-radius: 999px;
}

.look-frame,
.player-big,
.win-card,
.lobby-banner {
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* your own frame: no outline, a pink dot next to the name */
.look-frame.is-me {
  outline: none;
}

.me-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.1rem;
  border-radius: 50%;
  background: #ff5fa8;
}
