.jb3d-crossword {
  --jb-dark: #1b1b1b;
  --jb-red: #c8102e;
  --jb-light: #ededed;
  --jb-panel: #282828;
  box-sizing: border-box;
  max-width: 920px;
  padding: clamp(22px, 4vw, 42px);
  background: var(--jb-dark) !important;
  color: var(--jb-light) !important;
  border: 1px solid #424242;
  border-top: 4px solid var(--jb-red);
  border-radius: 8px;
  font-family: inherit;
}
.jb3d-crossword * { box-sizing: border-box; }
.jb3d-crossword__eyebrow {
  color: #ff526b !important;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.jb3d-crossword h2 {
  color: #fff !important;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  margin: .4em 0 .3em;
}
.jb3d-crossword p { color: var(--jb-light) !important; line-height: 1.5; }
.jb3d-crossword__layout {
  display: flex;
  gap: clamp(24px, 4vw, 44px);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 24px;
}
.jb3d-crossword__board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr));
  width: min(100%, 430px);
  gap: 2px;
  background: var(--jb-dark);
  flex: none;
}
.jb3d-crossword__cell {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  background: var(--jb-light);
}
.jb3d-crossword__cell.is-empty { background: transparent; }
.jb3d-crossword__cell.is-selected { background: #facbd3; }
.jb3d-crossword__cell.is-current {
  background: var(--jb-red);
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 1;
}
.jb3d-crossword__cell.is-wrong { background: #f7a9b5; outline: 2px solid var(--jb-red); }
.jb3d-crossword__cell input {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 8px 0 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--jb-dark) !important;
  box-shadow: none !important;
  text-align: center;
  text-transform: uppercase;
  font: 700 clamp(13px, 3vw, 22px)/1 Arial, sans-serif;
  outline: none;
}
.jb3d-crossword__cell.is-current input { color: #fff !important; }
.jb3d-crossword__number {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 1;
  color: #333;
  font: 700 9px/1 Arial, sans-serif;
  pointer-events: none;
}
.jb3d-crossword__cell.is-current .jb3d-crossword__number { color: #fff; }
.jb3d-crossword__side { flex: 1; min-width: 230px; }
.jb3d-crossword__active {
  min-height: 3em;
  margin: 0 0 18px;
  padding: 8px 12px;
  border-left: 4px solid var(--jb-red);
  background: var(--jb-panel);
  color: #fff !important;
}
.jb3d-crossword h3 { color: #fff !important; font-size: 1rem; margin: 18px 0 7px; }
.jb3d-crossword__clue {
  display: block;
  width: 100%;
  margin: 2px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--jb-light);
  text-align: left;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}
.jb3d-crossword__clue:hover,
.jb3d-crossword__clue.is-selected {
  background: var(--jb-panel);
  border-left: 3px solid var(--jb-red);
  color: #fff;
}
.jb3d-crossword__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.jb3d-crossword__actions button {
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #a5a5a5;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: 700 .9rem/1.2 Arial, sans-serif;
  cursor: pointer;
}
.jb3d-crossword__actions button[data-action="check"] {
  border-color: var(--jb-red);
  background: var(--jb-red);
}
.jb3d-crossword__actions button:hover,
.jb3d-crossword__actions button:focus-visible { border-color: #fff; background: #a70d27; color: #fff; }
.jb3d-crossword__status { min-height: 1.5em; font-weight: 700; }
@media (max-width: 520px) {
  .jb3d-crossword__board { width: 100%; }
  .jb3d-crossword__cell input { font-size: clamp(12px, 4vw, 19px); }
}
