@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root {
  color: #292927;
  background: #f5f5f5;
  font: 500 14px 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 760px; margin: auto; padding: 0 12px 32px; }
header { padding: clamp(24px, 5vh, 48px) 0 0; text-align: center; }
header a { color: inherit; text-decoration: none; font-size: 15px; font-weight: 700; letter-spacing: 3px; }
.arena { position: relative; margin: auto; }
.arena canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.dice-pair {
  position: absolute;
  top: 28%;
  display: flex;
  gap: 5px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#left-dice { left: 22.222%; }
#right-dice { left: 77.778%; }
.roll-result {
  position: absolute;
  left: 50%;
  top: 13%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  font-weight: 700;
}
#roll-dice { position: static; transform: none; gap: 7px; }
.die {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 1px;
  width: 24px;
  height: 24px;
  padding: 3px;
  border: 2px solid #222;
  background: white;
  box-shadow: 2px 2px #222;
}
#roll-dice .die {
  width: clamp(29px, 5vw, 34px);
  height: clamp(29px, 5vw, 34px);
  padding: 5px;
  box-shadow: 3px 3px #222;
}
.pip { background: #222; }
.arena-label { position: absolute; bottom: 79%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; letter-spacing: .6px; }
.left-label { left: 22.222%; }
.right-label { left: 77.778%; }
.control { text-align: center; margin: 16px auto 0; }
.room-top, .actions, .join { display: flex; align-items: center; justify-content: center; }
.room-top, .actions { flex-wrap: wrap; gap: 8px; }
.room-top h2 { font-size: 12px; margin: 0; }
.room-code { font-size: 11px; color: #686863; }
.room-code strong { color: #292927; letter-spacing: 1px; }
.control p { margin: 8px 0; font-size: 12px; }
.actions { margin-top: 16px; }
button, input { font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .3px; }
button { cursor: pointer; min-height: 44px; padding: 0 16px; color: inherit; background: transparent; border: 2px solid #292927; }
button:hover { background: #e5e5e1; }
.primary { color: #faf9f5; background: #292927; }
.primary:hover { background: #474743; }
.join { border: 2px solid #292927; }
.join input { width: 108px; min-height: 40px; padding: 0 12px; text-transform: uppercase; border: 0; background: transparent; }
.join button { min-height: 40px; border: 0; border-left: 2px solid #292927; }
.text-button { border-color: transparent; color: #686863; }
:focus-visible { outline: 2px solid #777772; outline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; }
.error { color: #a63f23; }
.error:empty, [hidden] { display: none !important; }
