@import url("arcade-games.css");

/* Realm Tavern — the chat room takes the whole page, so it layers a full-screen
   column on top of the shared chat primitives in theme.css (which style the
   small floating panel Crystal Match uses). */

.tavern {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0 env(safe-area-inset-bottom, 0px);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(94, 200, 192, 0.16), transparent 55%),
    linear-gradient(180deg, #1a3a2a 0%, #0d1a12 55%, #142218 100%);
}

.tavern-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.75rem 0.6rem calc(3.6rem + env(safe-area-inset-left, 0px)); /* clear of .exit-btn */
  border-bottom: 1px solid var(--panel-border);
}

.tavern-code {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
  white-space: nowrap;
}

.tavern-count {
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.ghost-btn.tiny {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

/* Below the bar the room reads as one column, centred on wide screens so
   messages don't run the full width of a desktop display. */
.roster,
.tavern .chat-log,
.typing-line,
.tavern .chat-compose {
  width: min(100%, 52rem);
  margin-inline: auto;
}

.roster {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--panel-border);
  scrollbar-width: thin;
}

.seat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  max-width: 10rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat.you {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.seat .dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
}

/* Override the fixed-height log from theme.css: here it owns the page. */
.tavern .chat-log {
  flex: 1;
  height: auto;
  min-height: 0;
  gap: 0.45rem;
  padding: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.tavern .chat-msg .who {
  color: var(--crystal); /* per-seat colour is set inline from the peer id */
}

.tavern .chat-msg.mine {
  align-self: flex-end;
  max-width: 85%;
  text-align: right;
}

.typing-line {
  min-height: 1.1rem;
  padding: 0 0.75rem;
  font-size: 0.76rem;
  font-style: italic;
  color: rgba(243, 231, 199, 0.55);
}

.tavern .chat-compose {
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
}

.tavern .chat-input {
  font-size: 1rem; /* 16px+ keeps iOS from zooming the page on focus */
  padding: 0.6rem 0.7rem;
}

.tavern .chat-send {
  padding: 0.6rem 0.9rem;
}

/* Lobby name field, sitting above the shared room-code row. */
.name-input {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  width: 15rem;
  max-width: 100%;
  padding: 0.7rem 0.6rem;
  margin-bottom: 0.6rem;
  border: 2px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--parchment);
  -webkit-user-select: text;
  user-select: text;
}

.name-input:focus {
  outline: none;
  border-color: var(--gold);
}

.title-card .lobby-row + .lobby-row {
  margin-top: 0.2rem;
}
