.raetsel-wrap {
  max-width: 100%;
  font-family: inherit;
}
.raetsel-toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.raetsel-toolbar a,
.raetsel-toolbar button {
  border: 1px solid #444;
  background: #fff;
  color: #222;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
}
.raetsel-grid {
  display: grid;
  grid-template-columns: repeat(var(--raetsel-cols), minmax(2rem, 2rem));
  width: max-content;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #222;
}
.raetsel-cell {
  position: relative;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid #222;
  box-sizing: border-box;
  background: #fff;
  display: block;
}
.raetsel-block {
  background: #fdc150;
}
.raetsel-grid .raetsel-block {
  border: none;
}

.raetsel-cell.highlighted::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253, 193, 80, 0.3);
  z-index: 0;
}
.raetsel-cell.focused::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253, 193, 80, 0.5);
  z-index: 0;
}
.raetsel-cell.focused.highlighted::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253, 193, 80, 0.5);
  z-index: 0;
}
.raetsel-cell input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 600;
  outline: none;
  z-index: 1;
}
.raetsel-cell input:focus {
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.18);
}
.raetsel-number {
  position: absolute;
  z-index: 2;
  left: 2px;
  top: 1px;
  font-size: 8px;
  line-height: 1;
  color: #111;
  pointer-events: none;
}

/* Raetsel02 spezifisches CSS */
.raetsel-type-02 .raetsel-block,
.raetsel-type-02 .raetsel-empty {
  background: transparent !important;
  border: none !important;
}
.raetsel-number-cell {
  background: #fdc150 !important;
  border-color: #222;
  cursor: default;
}
.raetsel-number-cell:hover {
  background: #f5b030 !important;
}
.raetsel-number-cell .raetsel-number-cell-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.raetsel-single-number {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 1px;
}
.raetsel-single-number .raetsel-single-num {
  position: relative;
  display: inline-block;
}
.raetsel-single-number .raetsel-single-arrow {
  position: relative;
  display: inline-block;
}

.raetsel-single-number[data-arrow="right"] .raetsel-single-num { order: 1; }
.raetsel-single-number[data-arrow="right"] .raetsel-single-arrow { order: 2; }
.raetsel-single-number[data-arrow="left"] .raetsel-single-num { order: 2; }
.raetsel-single-number[data-arrow="left"] .raetsel-single-arrow { order: 1; }
.raetsel-single-number[data-arrow="down"] .raetsel-single-num { order: 1; }
.raetsel-single-number[data-arrow="down"] .raetsel-single-arrow { order: 2; }
.raetsel-single-number[data-arrow="up"] .raetsel-single-num { order: 2; }
.raetsel-single-number[data-arrow="up"] .raetsel-single-arrow { order: 1; }

.raetsel-single-num,
.raetsel-multi-num {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #111;
  pointer-events: none;
  z-index: 3;
}

.raetsel-single-arrow,
.raetsel-multi-arrow {
  font-size: 13px;
  line-height: 1;
  color: #111;
  pointer-events: none;
  z-index: 3;
}

.raetsel-single-arrow::after,
.raetsel-multi-arrow::after {
  content: '\276F';
  display: inline-block;
}

.raetsel-single-arrow[data-arrow="right"]::after,
.raetsel-multi-arrow[data-arrow="right"]::after { transform: rotate(0deg); }
.raetsel-single-arrow[data-arrow="left"]::after,
.raetsel-multi-arrow[data-arrow="left"]::after { transform: rotate(180deg); }
.raetsel-single-arrow[data-arrow="down"]::after,
.raetsel-multi-arrow[data-arrow="down"]::after { transform: rotate(90deg); }
.raetsel-single-arrow[data-arrow="up"]::after,
.raetsel-multi-arrow[data-arrow="up"]::after { transform: rotate(-90deg); }

.raetsel-single-number[data-arrow="right"] .raetsel-single-arrow { margin-left: 2px; }
.raetsel-single-number[data-arrow="left"] .raetsel-single-arrow { margin-right: 2px; }
.raetsel-single-number[data-arrow="down"] .raetsel-single-arrow { margin-top: 2px; }
.raetsel-single-number[data-arrow="up"] .raetsel-single-arrow { margin-bottom: 2px; }

/* Diagonale Trennlinie für doppelte Zahlenfelder */
.raetsel-number-cell[data-multiple="1"] .raetsel-number-cell-content::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 142%; height: 1.5px;
  background: #111;
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 1;
  pointer-events: none;
}

.raetsel-multi-number {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.raetsel-multi-number .raetsel-multi-num {
  position: relative;
  display: inline-block;
}

.raetsel-multi-number .raetsel-multi-arrow {
  position: relative;
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  color: #111;
}

.raetsel-multi-number[data-entry-idx="0"] {
  top: 0; right: 0;
  width: 55%; height: 50%;
  justify-content: flex-end;
  align-items: flex-start;
  padding-right: 3px;
  padding-top: 1px;
}
.raetsel-multi-number[data-entry-idx="1"] {
  bottom: 0; left: 0;
  width: 55%; height: 50%;
  justify-content: flex-start;
  align-items: flex-end;
  padding-left: 3px;
  padding-bottom: 1px;
}

/* Leere Zellen bei Raetsel02 */
.raetsel-empty {
  background: transparent !important;
  border: none !important;
}
.raetsel-clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
.raetsel-clues h3 {
  margin: 0 0 0.6rem;
}
.raetsel-clues ol {
  margin: 0;
  padding-left: 2.2rem;
}
.raetsel-clues li {
  font-size: clamp(0.95rem, 1.5rem, 2.5rem);
  margin: 0 0 0.45rem;
  padding-left: 0.2rem;
  cursor: pointer;
}
.raetsel-words-list {
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
  padding: 0;
  margin: 1rem 0;
}
.raetsel-words-list li {
  margin: 0.3rem 0;
  padding-left: 0.2rem;
}
@media (max-width: 700px) {
  .raetsel-cell {
    width: 30px;
  }
  .raetsel-cell input {
    font-size: 18px;
  }
  .raetsel-clues {
    grid-template-columns: 1fr;
  }
}
code {
  white-space: unset !important;
  line-height: 1.0 !important;
}
code label {
  margin-bottom: 0px !important;
}
.raetsel-clues li {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  word-break: normal;
}

.raetsel-grid label {
  margin-bottom: 0px;
}