* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f3f6fa;
  color: #102742;
  font:
    15px Arial,
    sans-serif;
}
button {
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  padding: 10px;
}
button:hover {
  background: #e5effb;
}
button:disabled {
  cursor: default;
  opacity: 0.7;
}
header {
  background: #fff;
  border-bottom: 1px solid #e0e7ee;
}
nav,
main {
  width: 94%;
  max-width: 1720px;
  margin: auto;
}
nav,
.top,
strong {
  display: flex;
  align-items: center;
}
nav {
  height: 72px;
  gap: 18px;
}
strong {
  font: bold italic 24px Arial;
  letter-spacing: -1px;
  margin-right: auto;
}
strong svg {
  margin-right: 10px;
}
strong b,
.tips i {
  color: #0865dc;
}
i {
  display: inline-flex;
}
i svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top {
  gap: 10px;
  margin: 24px 0 19px;
}
h1 {
  font-size: clamp(24px, 2.45vw, 38px);
  margin: 0;
  letter-spacing: -1.3px;
}
.top span {
  margin-right: auto;
  background: #dfeafe;
  color: #165bc1;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.top button,
aside {
  background: white;
  border: 1px solid #dfe6ee;
}
.top button:hover {
  color: #065ed5;
}
.layout {
  display: grid;
  grid-template-columns: 1fr clamp(310px, 24vw, 370px);
  gap: 22px;
}
#arena {
  position: relative;
  overflow: hidden;
  border-radius: 21px;
  background: #fee0a0;
  min-height: 535px;
  height: clamp(560px, calc(100dvh - 190px), 990px);
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
aside {
  padding: 24px;
  border-radius: 20px;
  align-self: start;
}
h2 {
  font-size: 22px;
  margin: 0 0 19px;
  letter-spacing: -0.6px;
}
#modes,
#seats {
  display: grid;
  gap: 10px;
}
#modes button,
#seats button {
  border: 1px solid #dce3ec;
  justify-content: flex-start;
  text-align: left;
  padding: 14px 12px;
  gap: 12px;
}
#modes button[aria-pressed="true"] {
  background: #edf5ff;
  border-color: #0969ee;
  box-shadow: inset 0 0 0 1px #0969ee;
  color: #065dd1;
}
#modes button:after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #bac7d5;
  margin-left: auto;
}
#modes button[aria-pressed="true"]:after {
  border: 5px solid #0766e2;
  width: 7px;
  height: 7px;
  background: white;
}
#modes small {
  display: block;
  font-size: 13px;
  color: #556980;
  font-weight: 400;
  margin-top: 5px;
}
#modes svg {
  width: 29px;
  height: 29px;
}
.primary,
#ready {
  background: #0964df;
  color: white;
  padding: 16px;
  width: 100%;
  margin-top: 20px;
  font-size: 16px;
}
.primary:hover,
#ready:hover {
  background: #004dbd;
}
.tips {
  border-top: 1px solid #e2e8ef;
  margin-top: 24px;
  padding-top: 20px;
}
h3 {
  margin: 0 0 15px;
  font-size: 17px;
}
.tips p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536980;
  font-size: 13px;
  margin: 13px 0 0;
}
.tips b {
  margin-left: auto;
  color: #152c48;
}
.tips svg {
  width: 18px;
}
#board,
#hint,
#ready {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  box-shadow: 0 4px 15px #18416b21;
}
#board,
#hint {
  pointer-events: none;
  display: flex;
  align-items: center;
  top: 18px;
  border-radius: 15px;
  background: #102944f5;
  color: white;
  padding: 10px 18px;
  font-weight: bold;
  gap: 15px;
}
#board div {
  display: flex;
  align-items: center;
  gap: 10px;
}
#board b {
  font-size: 25px;
}
em {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b95ff;
}
#board div:last-child em {
  background: #ff664c;
}
#set {
  color: #d5e3f3;
  border-inline: 1px solid #44607a;
  padding: 4px 13px;
}
#hint {
  top: 78px;
  padding: 6px 12px;
  font-size: 13px;
}
#ready {
  bottom: 15px;
  width: auto;
  margin: 0;
  padding: 12px 26px;
}
#leave {
  width: 100%;
  margin-top: 8px;
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 30px;
  max-width: min(580px, 94vw);
  color: inherit;
  line-height: 1.55;
}
dialog::backdrop {
  background: #041d3d88;
}
form {
  float: right;
}
form button {
  font-size: 24px;
  padding: 0 8px;
}
dialog h3 {
  margin: 15px 0 3px;
}
[hidden] {
  display: none !important;
}
#arena:fullscreen {
  height: 100dvh;
}
#error {
  color: #a42a23;
  margin: 6px;
}
@media (max-width: 950px) {
  .layout {
    display: block;
  }
  aside {
    margin-top: 14px;
  }
  #arena {
    height: 65dvh;
    min-height: 420px;
  }
  .top {
    margin: 14px 0;
  }
  nav {
    height: 58px;
    gap: 0;
  }
  nav button {
    font-size: 13px;
    padding: 7px;
  }
  strong {
    font-size: 18px;
  }
  strong svg {
    width: 29px;
    margin-right: 4px;
  }
  .top span,
  nav i {
    display: none;
  }
  h1 {
    margin-right: auto;
    font-size: 21px;
  }
  .top button {
    padding: 7px;
  }
  #board {
    font-size: 12px;
    gap: 8px;
    padding: 7px 12px;
    top: 10px;
  }
  #board b {
    font-size: 20px;
  }
  #hint {
    top: 54px;
    font-size: 11px;
  }
  .top {
    gap: 5px;
  }
}
@media (max-height: 770px) and (min-width: 951px) {
  nav {
    height: 52px;
  }
  .top {
    margin: 10px 0;
  }
  #arena {
    height: calc(100dvh - 126px);
    min-height: 470px;
  }
  aside {
    padding: 16px;
  }
  #modes button {
    padding: 10px;
  }
  .tips {
    margin-top: 15px;
    padding-top: 12px;
  }
}
#hint.live {
  top: auto;
  bottom: 10px;
}
.trace {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.trace input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0964df;
}
