/* Plaintext — Dicebound, the game on /play. Builds on assets/style.css. */

[hidden] {
  display: none !important;
}

.game h2 {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 2rem 0 0.75rem;
}

.notice {
  font-family: var(--sans);
  font-size: 0.875rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.6rem 0.9rem;
  margin: 1.5rem 0 0;
}

/* Buttons */

.btn {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: var(--surface);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.1);
}

.btn.small {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
}

.btn.quiet {
  border-color: transparent;
  color: var(--muted);
}

.btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled,
.card:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Menu */

.doors button {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 0;
  padding: 1.4rem 1.4rem 1.5rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.doors button:hover,
.doors button[aria-expanded="true"] {
  background: var(--surface);
}

.doors button .eyebrow {
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.panel {
  max-width: 62rem;
  margin: -1.5rem 0 3rem;
  padding: 1.4rem;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.panel h2 {
  margin-top: 0;
}

.code-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

.code-form input,
.invite input {
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.5rem 0.6rem;
}

.code-form input {
  width: 6.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.tables {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.tables li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}

.tables li span {
  flex: 1 1 14rem;
}

/* Lobby */

.lobby-head {
  padding-top: 3rem;
}

.lobby-head h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 1rem;
}

#lobby-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.invite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 40rem;
}

.invite input {
  flex: 1 1 14rem;
  min-width: 0;
  font-size: 0.8125rem;
}

.seats,
.party,
.order {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.4;
}

.seats {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  max-width: 62rem;
}

@media (min-width: 48rem) {
  .seats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.seats li {
  background: var(--bg);
  padding: 0.9rem 1rem;
  min-height: 4.5rem;
}

.seats li.empty {
  color: var(--muted);
}

.seats strong,
.seats .meta {
  display: block;
}

.glyph {
  font-size: 1.4rem;
  line-height: 1;
}

.cards,
.choices {
  display: grid;
  gap: 0.6rem;
  max-width: 62rem;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  }
}

.card {
  display: block;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.card:hover:not(:disabled) {
  background: var(--surface);
}

.card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.card strong,
.card span {
  display: block;
}

.card strong {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.card .meta {
  margin-top: 0.35rem;
}

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

/* Table */

.table-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 1.5rem 0 0.6rem;
}

.table-bar p {
  margin: 0;
}

#timer {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.table-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 62rem) {
  .table-grid {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

.board {
  position: relative;
  background: #111;
  border: 1px solid var(--rule);
  line-height: 0;
}

.board canvas {
  display: block;
  width: 100%;
  aspect-ratio: 12 / 8;
  touch-action: manipulation;
}

.board[data-world="crypt"] {
  --glow: #e3bd6f;
}

.board[data-world="neon"] {
  --glow: #48eaff;
}

.board[data-world="grove"] {
  --glow: #bfe871;
}

.die {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100% - 1.2rem);
  padding: 0.4rem 0.7rem 0.4rem 0.4rem;
  background: rgba(0, 0, 0, 0.78);
  color: #f1efe9;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.3;
  pointer-events: none;
}

.die b {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--glow, #fff);
  border-radius: 0.4rem;
}

.die.ok b {
  background: #2f7d3b;
  border-color: #2f7d3b;
}

.die.fail b {
  background: #8a2f24;
  border-color: #8a2f24;
}

.die.crit b {
  background: #d9a521;
  border-color: #d9a521;
  color: #1b1b19;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  line-height: 1.5;
  overflow-y: auto;
}

.sheet {
  width: min(100%, 30rem);
  background: var(--bg);
  color: var(--text);
  border-top: 3px solid var(--glow, var(--accent));
  padding: 1.25rem 1.4rem 1.4rem;
  font-size: 1rem;
}

.sheet h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.sheet p {
  margin: 0 0 0.9rem;
}

.sheet .score {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.sheet table {
  margin-bottom: 1rem;
}

.sheet .choices {
  margin-bottom: 0.9rem;
}

.hint {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  min-height: 1.4em;
  margin: 0.7rem 0;
  line-height: 1.4;
}

.actions,
.emotes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.actions .quiet {
  margin-left: auto;
}

.emotes {
  margin-top: 0.9rem;
}

.side h2:first-child {
  margin-top: 0;
}

.party li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.6rem 0 0.6rem 0.7rem;
  border-left: 3px solid var(--rule);
  margin-bottom: 0.5rem;
}

.party li.active {
  background: var(--surface);
}

.party li.down {
  opacity: 0.55;
}

.party div {
  flex: 1;
  min-width: 0;
}

.party strong,
.party .meta {
  display: block;
}

.bar {
  display: block;
  height: 0.35rem;
  background: var(--rule);
  margin: 0.3rem 0;
}

.bar span {
  display: block;
  height: 100%;
  background: #4f9d55;
}

.order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.order li {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--rule);
  color: var(--muted);
}

.order li.hero {
  color: var(--text);
}

.order li.active {
  border-color: var(--accent);
  color: var(--accent);
}

.order li.down {
  text-decoration: line-through;
}

.log {
  height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--rule);
  padding: 0.6rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.log p {
  margin: 0 0 0.35rem;
}

.log p:last-child {
  color: var(--text);
}
