html .classroom-game-cover[data-classroom-game-cover="dots_and_boxes"] {
  --cover-canvas: #241750;
  --cover-ink: #fff8eb;
  --cover-accent: #ffcf64;
  --cover-width: min(100%, 940px, max(500px, calc((100svh - 310px) * 1.77778)));
}
.classroom-game-cover[data-classroom-game-cover="dots_and_boxes"] [data-opening-part="poster"] {
  display: grid;
  padding: 10px 10px 14px;
  gap: 8px;
}
.classroom-game-cover[data-classroom-game-cover="dots_and_boxes"] [data-opening-part="art"] { border-radius: 14px; }
[data-classroom-game-cover="dots_and_boxes"][data-title-in-art="false"] [data-opening-part="title"] {
  position: static !important;
  grid-row: 1;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 900;
}
.classroom-game-cover[data-classroom-game-cover="dots_and_boxes"] [data-opening-part="actions"] { position: static; padding: 6px; }
#classroom-play-toolbar[data-game="dots_and_boxes"] {
  color: #fff;
  background: #28196b;
  border-bottom: 2px solid #b496ff;
}
#classroom-play-toolbar[data-game="dots_and_boxes"] h1 { color: #fff; text-shadow: 0 2px 2px #17023d; }
.dots-arena {
  color: #fff;
  background: #291c70 url("./arena.505c114788e4.webp") center top / cover no-repeat;
  min-height: calc(100svh - var(--classroom-play-height, 72px));
  padding: clamp(12px, 2vh, 24px) clamp(8px, 2vw, 28px) 24px;
  box-sizing: border-box;
  isolation: isolate;
  word-break: keep-all;
  font: 600 16px/1.4 system-ui, -apple-system, sans-serif;
}
.dots-goal, .dots-bottom p {
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 8px 20px;
  background: #fff3cf;
  color: #37225b;
  border: 2px solid #ffda86;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
}
.dots-stage {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(276px, 2.75fr) minmax(130px, 1fr);
  gap: clamp(12px, 2vw, 26px);
  align-items: center;
  max-width: 1040px;
  margin: 8px auto 10px;
}
.dots-center { display: grid; min-width: 0; justify-items: center; gap: 6px; }
.dots-turn {
  min-width: 150px;
  min-height: 38px;
  box-sizing: border-box;
  border: 2px solid #ffa6ae;
  border-radius: 99px;
  margin: 0;
  padding: 5px 14px;
  background: #981f46;
  color: #fff;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 900;
  text-align: center;
}
.dots-turn[data-dots-turn="2"] { background: #12458e; border-color: #a4d5ff; }
.dots-turn[data-dots-turn="0"] { background: #46277f; border-color: #d4bfff; }
.dots-board-rim {
  display: grid;
  place-items: stretch;
  width: min(100%, max(284px, calc(100svh - 254px)), 566px);
  aspect-ratio: 1;
  padding: clamp(29px, 4.5vw, 65px);
  box-sizing: border-box;
  border-radius: clamp(24px, 4vw, 60px);
  border: 7px solid #ac77eb;
  background: #fff3d7;
  box-shadow: inset 0 0 0 4px #ffcf6a, inset 0 0 0 9px #fbe0ab, 0 6px 0 #6747a2, 0 14px 26px #20104c88;
}
.dots-board { position: relative; background: #f5eaff; min-width: 0; }
.dots-point, .dots-edge, .dots-box { position: absolute; translate: -50% -50%; }
.dots-point {
  width: clamp(10px, 2vw, 23px);
  aspect-ratio: 1;
  border: 2px solid #452084;
  border-radius: 50%;
  box-shadow: inset 1px 3px 3px #ffffff80, 0 1px 3px #2e146969;
  background: #6a43bb;
  pointer-events: none;
  z-index: 3;
}
.dots-edge {
  border: 0;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 2;
}
.dots-edge--horizontal { width: calc(100% / var(--size)); height: 44px; }
.dots-edge--vertical { height: calc(100% / var(--size)); width: 44px; }
.dots-edge::after {
  position: absolute;
  content: "";
  background: #c9b5e5;
  border-radius: 5px;
  inset: calc(50% - 2px) 0;
}
.dots-edge--vertical::after { inset: 0 calc(50% - 2px); }
.dots-edge[data-team="1"]::after { background: #b41b4a; box-shadow: inset 0 2px #ff8da8; }
.dots-edge[data-team="2"]::after { background: #1956a6; box-shadow: inset 0 2px #73c8ff; }
.dots-edge[aria-disabled="true"] { cursor: default; }
.dots-edge:not([aria-disabled]):hover::after,
.dots-edge:focus-visible::after { background: #704bb4; }
.dots-edge:focus-visible, .dots-arena button:focus-visible { outline: 3px solid #ffe16f; outline-offset: -1px; z-index: 4; }
.dots-box {
  display: grid;
  place-items: center;
  width: calc(100% / var(--size) - 6px);
  height: calc(100% / var(--size) - 6px);
  border-radius: 10px;
  pointer-events: none;
  font-size: clamp(14px, 3vw, 30px);
}
.dots-box[data-team="1"] { color: #a91543; background: #fbc4d5; animation: dots-claim .26s ease-out; }
.dots-box[data-team="2"] { color: #144e9c; background: #c1deff; animation: dots-claim .26s ease-out; }
@keyframes dots-claim { from { scale: .72; opacity: .45; } to { scale: 1; opacity: 1; } }
.dots-team {
  align-self: center;
  position: relative;
  overflow: hidden;
  background: #ffd4e3;
  color: #83143a;
  border: 4px solid #f386a9;
  border-radius: 26px;
  text-align: center;
  box-shadow: 0 5px 0 #7e234f7a, 0 6px 20px #1e144777;
}
.dots-team h2 {
  box-sizing: border-box;
  background: #9a2047;
  color: #fff;
  margin: 7px;
  padding: 5px;
  border-radius: 14px;
  font-size: clamp(17px, 2.25vw, 23px);
}
.dots-team p {
  margin: 6px 9px 4px;
  padding: 2px 5px;
  border-radius: 15px;
  background: #fff7ec;
  font-weight: 800;
}
.dots-team strong { font-size: clamp(28px, 4.6vw, 64px); line-height: 1.05; margin-right: 3px; }
.dots-team img { display: block; width: 100%; height: auto; aspect-ratio: 18 / 17; object-fit: contain; margin: 0; }
.dots-blue { background: #cdeaff; color: #103e76; border-color: #76c5fe; box-shadow: 0 5px 0 #10459c99, 0 6px 20px #1e144777; }
.dots-blue h2 { background: #175aa5; }
.dots-bottom { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px auto 0; text-align: center; }
.dots-bottom p { display: grid; place-items: center; margin: 0; }
.dots-bottom button, .dots-size button {
  min-height: 44px;
  padding: 7px 13px;
  background: #fff8e7;
  color: #3c2564;
  border: 2px solid #c6a4ed;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
}
.dots-size {
  margin: auto;
  width: min(400px, calc(100vw - 24px));
  box-sizing: border-box;
  background: #fff9f0;
  color: #39275a;
  padding: 22px;
  border: 2px solid #c6a4ed;
  border-radius: 18px;
}
.dots-size::backdrop { background: #1c0e4ab0; }
.dots-size h2 { font-size: 22px; margin: 0; }
.dots-size p { margin: 8px 0 16px; }
.dots-size form { display: flex; flex-wrap: wrap; gap: 8px; }
.dots-size button:disabled { opacity: .55; cursor: default; }
#dots-result-host { max-width: min(620px, 100%); margin: 0 auto; }
.dots-arena .pg-dots_and_boxes { --pg-cell: clamp(32px, 6vw, 58px); }
@media (max-width: 640px) {
  html .classroom-game-cover[data-classroom-game-cover="dots_and_boxes"] { --cover-width: 100%; }
  .dots-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 500px; gap: 8px; }
  .dots-center { grid-column: 1 / -1; grid-row: 2; }
  .dots-team { grid-row: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; border-width: 2px; border-radius: 16px; }
  .dots-team h2 { margin: 3px; padding: 4px 7px; font-size: 16px; }
  .dots-team p { padding: 2px 4px; margin: 4px; }
  .dots-team strong { font-size: 24px; }
  .dots-team img { display: none; }
  .dots-board-rim { width: min(100%, 460px); border-width: 4px; padding: 23px; }
  .dots-goal, .dots-bottom p { font-size: 15px; }
  .dots-arena { background-position: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dots-box[data-team] { animation: none; }
}
.dots-brand { display: none; }
@media (min-width: 900px) {
  #classroom-play-toolbar[data-game="dots_and_boxes"] .dots-brand {
    display: block;
    color: #f8e9ff;
    font-weight: 850;
    font-size: 19px;
    flex: 1;
  }
  #classroom-play-toolbar[data-game="dots_and_boxes"] h1 {
    position: absolute;
    left: 50%;
    translate: -50% 0;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 3px 23px 4px;
    border: 2px solid #d9b3ff;
    border-radius: 999px;
    background: linear-gradient(180deg, #8054cf, #5630a6 52%, #6b43be);
    font-size: 33px;
    letter-spacing: -.018em;
    box-shadow: inset 0 2px #b68aff, 0 4px #170d43;
  }
  #classroom-play-toolbar[data-game="dots_and_boxes"] h1::before {
    content: "";
    width: 28px;
    height: 28px;
    flex: none;
    background:
      radial-gradient(circle at 5px 5px, #fff2bb 4px, transparent 5px),
      radial-gradient(circle at 23px 5px, #ffd274 4px, transparent 5px),
      radial-gradient(circle at 5px 23px, #ffd274 4px, transparent 5px),
      radial-gradient(circle at 23px 23px, #fff2bb 4px, transparent 5px),
      linear-gradient(#ffc163, #ffc163) 5px 4px / 18px 2px no-repeat,
      linear-gradient(#ffc163, #ffc163) 5px 22px / 18px 2px no-repeat,
      linear-gradient(#ffc163, #ffc163) 4px 5px / 2px 18px no-repeat,
      linear-gradient(#ffc163, #ffc163) 22px 5px / 2px 18px no-repeat;
  }
  .dots-center { position: relative; }
  .dots-turn {
    position: absolute;
    top: 7%;
    left: 0;
    z-index: 5;
    box-shadow: 0 3px 0 #241646a0;
  }
  .dots-board-rim {
    position: relative;
    display: block;
    width: min(100%, max(330px, calc(100svh - 228px)), 570px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 12px 12px #20104c88);
  }
  .dots-board-rim::before {
    content: "";
    position: absolute;
    inset: 15% 8% 8%;
    background: #fff2db;
    border-radius: 11%;
  }
  .dots-board-rim::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("./frame.b56ba80bb507.webp") center / 100% 100% no-repeat;
    pointer-events: none;
  }
  .dots-board { position: absolute; inset: 21% 16% 14%; z-index: 1; }
  .dots-team { margin-top: 28px; }
  .dots-team h2 {
    padding-block: 7px;
    border: 2px solid #ffffff83;
    box-shadow: 0 3px 0 #83143a62, inset 0 3px #ffffff3b;
    background-image: linear-gradient(#ffffff33, transparent);
  }
  .dots-team p { padding-block: 5px; }
  .dots-team strong { font-size: clamp(48px, 5.2vw, 66px); }
  .dots-team img {
    aspect-ratio: 18 / 19;
    object-position: center bottom;
    scale: 1.2;
    transform-origin: center bottom;
  }
  .dots-bottom p { padding-inline: 28px; font-size: 18px; }
}
.dots-edge--horizontal[data-team]::after { animation: dots-grow-x .18s ease-out; }
.dots-edge--vertical[data-team]::after { animation: dots-grow-y .18s ease-out; }
@keyframes dots-grow-x { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes dots-grow-y { from { scale: 1 0; } to { scale: 1 1; } }
@media (prefers-reduced-motion: reduce) {
  .dots-edge[data-team]::after { animation: none; }
}

.dots-arena[data-round-over] .dots-bottom { display: none; }
.dots-arena[data-round-over] #dots-result-host { margin-top: 16px; }
@media (max-width: 390px) {
  .dots-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .dots-bottom p { width: 100%; padding: 6px 4px; font-size: 14px; }
  .dots-bottom button { padding-inline: 7px; font-size: 14px; }
}
