
#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
}

/* HUD */

#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 9px 16px;
  flex: 0 0 auto;
  box-shadow: var(--soft-shadow);
}

.team-score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 90px;
}

.team-score.right {
  align-items: flex-end;
}

.team-score .tname {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  opacity: .85;
}

.team-score .tval {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold-l);
}

.hud-mid {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-line {
  font-size: .72rem;
  opacity: .8;
  white-space: nowrap;
}

#menu-btn {
  background: transparent;
  border: 1px solid rgba(212,175,55,.5);
  color: var(--gold);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1rem;
}

/* STATUS */

#status {
  text-align: center;
  font-size: .8rem;
  min-height: 18px;
  color: var(--gold-l);
  flex: 0 0 auto;
  font-weight: 500;
}

/* BOARD */

#board {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  gap: 6px;
}

#board.mode-2p {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0,1fr) auto;
  grid-template-areas:
    "north"
    "table"
    "south";
}

#board.mode-4p {
  grid-template-columns:
    minmax(64px,104px)
    minmax(0,1fr)
    minmax(64px,104px);

  grid-template-rows: auto minmax(0,1fr) auto;

  grid-template-areas:
    ". north ."
    "west table east"
    ". south .";
}

/* SEATS */

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 0;
  min-width: 0;
  --cw: 60px;
  --ch: 86px;
  padding: 3px;
  border-radius: 10px;
  transition: background .25s, box-shadow .25s;
}

.seat[data-seat="south"] {
  grid-area: south;
  --cw: 62px;
  --ch: 88px;
}

.seat[data-seat="north"] {
  grid-area: north;
}

.seat[data-seat="west"] {
  grid-area: west;
  justify-content: center;
}

.seat[data-seat="east"] {
  grid-area: east;
  justify-content: center;
}

#board.mode-2p .seat[data-seat="north"] {
  --cw: 50px;
  --ch: 72px;
}

#board.mode-4p .seat[data-seat="north"] {
  --cw: 44px;
  --ch: 63px;
}

#board.mode-4p .seat[data-seat="west"],
#board.mode-4p .seat[data-seat="east"] {
  --cw: 36px;
  --ch: 52px;
}

.seat.active {
  background: rgba(212,175,55,.09);
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.35);
}

.seat-head {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gold);
}

.pname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.chk-badge {
  color: var(--gold-l);
  font-size: .6rem;
  letter-spacing: 1px;
}

/* ACTION BAR */

#action-bar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 950;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  width: max-content;
  max-width: calc(100vw - 20px);
  pointer-events: none;
}

#action-bar:empty {
  display: none;
}

#action-bar > * {
  pointer-events: auto;
}

#action-bar .sel-info,
#action-bar .sel-btns {
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--soft-shadow);
}

#action-bar .sel-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
