html,
body {
  overflow: auto;
}

.bingo-main {
  margin: auto;
  width: 100%;
  min-height: 800px;
}

.bingo-header {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  /* border-bottom: 1px solid #ddd; */
  /* margin-bottom: 40px; */
}

.bingo-title {
  font-size: 2.5em;
  white-space: nowrap;
}

.bingo-header-controls {
  flex: 1;
  display: flex;
  /* align-items: flex-end; */
  justify-content: right;
  gap: 15px;
}

.bingo-header .bingo-header-controls {
  padding-bottom: 5px;
}

.bingo-header-controls > div {
  display: flex;
  gap: 15px;
  justify-content: right;
}

.bingo-code-container {
  min-width: 200px;
  cursor: pointer;
  position: relative;
  user-select: none;
  text-align: right;
}

.bingo-code-copied {
  display: none;
  text-align: right;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: #fff;
}

.bingo-code-container:hover::before {
  content: "(Click to copy) ";
}

.bingo-code-student,
.bingo-code-text {
  font-weight: bold;
}

.bingo-calling-controls,
.bingo-student-game-info,
.bingo-student-game-info-choose,
.bingo-student-game-info-mark,
.bingo-student-controls,
.bingo-print-controls {
  /* user-select: none; */
  display: flex;
  gap: 20px;
  text-align: center;
  align-items: baseline;
  justify-content: center;
  margin: 0;
  margin-top: 30px;
  margin-bottom: 40px;
  /* white-space: nowrap; */
  min-height: 22px;
}

.bingo-student-game-points {
  position: relative;
}

.bingo-student-game-points:not(:hover) .bingo-points-tooltip {
  display: none;
}

.bingo-points-tooltip {
  position: absolute;
  left: 0;
  top: 100%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #ccc;
  padding: 5px;
  white-space: nowrap;
}

.bingo-topic-count {
  display: inline-block;
  min-width: 1.1ch;
  text-align: left;
}

.bingo-topic-list {
  margin: auto;
  padding-left: 0;
  width: 75%;
  list-style-type: none;
  user-select: none;
  font-size: 1.2em;
}

.bingo-topic-list label {
  padding: 5px 0;
  display: block;
}

.bingo-topic-error {
  color: orange;
}

.bingo-print-controls input[name="total"] {
  width: 6ch;
}

.bingo-student-controls input[name="code_student"],
.bingo-print-controls input[name="code"] {
  width: 60px;
}

.bingo-load-error {
  display: none;
}

.bingo-board {
  break-inside: avoid;
  background-color: deepskyblue;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  border: 4px solid deepskyblue;
  text-align: center;
  font-size: 2.5em;
  user-select: none;
}

.bingo-board-4 {
  grid-template-columns: repeat(4, 1fr);
  font-size: 3em;
}

.bingo-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding: 0 0.5em;
  background-color: #fff;
  color: deepskyblue;
  font-size: 0.47em;
  font-weight: bold;
  gap: 3px;
}

.bingo-board .bingo-board-free {
  font-size: 0.4em;
}

.bingo-cell-header,
.bingo-cell {
  background-color: #fff;
  /* padding: 10px; */
  color: #003243;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: grid;
  align-items: center;
  justify-items: center;
  word-wrap: anywhere;
  overflow: hidden;
  cursor: default;
}

.bingo-cell-header {
  font-weight: bold;
  font-size: 1.1em;
  background-color: deepskyblue;
  color: #fff;
}

@media not print {
  .bingo-board-show-mark .bingo-mark {
    background-color: #ffdab9;
  }

  .bingo-board-show-mark .bingo-mark-win,
  .bingo-board-show-mark .bingo-mark-latest {
    background-color: lightgreen;
  }

  .bingo-board-show-mark .bingo-simulation-win {
    border-color: orange;
    box-shadow: 0 0 10px orange;
  }
}

.bingo-subpage {
  display: none;
}

.bingo-kakooma {
  border-collapse: collapse;
  margin: auto;
}

.bingo-kakooma td {
  border: 4px solid #000;
  width: 150px;
  height: 150px;
  text-align: center;
  font-size: 80px;
  color: deepskyblue;
}

.bingo-calling-numbers {
  text-align: center;
  display: flex;
  /* overflow-x: auto; */
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 40px;
  min-height: 50px;
  margin-inline: 180px;
  justify-content: center;
  flex-wrap: wrap;
}

.bingo-ball {
  min-width: 50px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border-top: 1px solid;
  border-left: 1px solid;
  border-bottom: 3px solid;
  border-right: 3px solid;
  border-color: deepskyblue;
  text-align: center;
  color: deepskyblue;
  font-size: 1.5em;
  font-weight: bold;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.bingo-calling-questions {
  overflow: auto;
  min-height: 62px;
  user-select: none;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.bingo-question-hidden {
  display: none;
}

.bingo-question {
  /* color: #aaa; */
}

.bingo-question-number {
  display: inline-block;
  min-width: 2.5ch;
  text-align: right;
}

.bingo-question-answer {
  display: inline-block;
  min-width: 2.5ch;
  text-align: center;
  border-bottom: 1px solid #000;
}

.bingo-question-text-screen {
  cursor: pointer;
}

.bingo-question-show-answer .bingo-answer-text-screen {
  cursor: pointer;
}

.bingo-current {
  /* color: #000; */
  /* background-color: #ffdab9; */
}

.bingo-question-show-answer .bingo-question-mark {
  /* background-color: #ffdab9; */
  background-color: lightgreen;
}

.bingo-question-pl {
  text-align: center;
}

@media not print {
  .bingo-question-pl {
    font-size: 2.5em;
  }
}

.bingo-question-pl.bingo-question-show-answer .bingo-question-mark {
  color: #000 !important;
}

@media not print {
  .bingo-question-text {
    font-size: 2.5em;
    text-align: center;
  }
}

.bingo-student-choose-board,
.bingo-teacher-overview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin-bottom: 25px;
  margin-inline: 100px;
}

.bingo-teacher-overview:not(.bingo-teacher-overview-show) {
  display: none;
}

.bingo-calling-controls-previous,
.bingo-calling-controls-next {
  min-width: 30px;
}

.bingo-calling-check {
  display: none;
}

.bingo-calling-check input {
  font-size: 2em;
  width: 6ch;
}

.bingo-student-header {
  user-select: none;
  min-height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.bingo-teacher-title {
  user-select: none;
  min-height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bingo-teacher-title,
.bingo-student-title,
.bingo-student-board-number-title {
  font-size: 2.5em;
  text-align: center;
}

.bingo-heart {
  font-family: monospace;
  font-size: 22px;
  display: inline-block;
  position: absolute;
  bottom: -3px;
  padding: 0px 5px;
  /* color: tomato; */
  color: deepskyblue;
  transition: color 0.3s;
}

@keyframes heart-lost {
  0% {
    transform: translate(2px, 0);
    color: tomato;
  }
  25% {
    transform: translate(-2px, 0);
  }
  50% {
    transform: translate(2px, 0);
  }
  75% {
    transform: translate(-2px, 0);
  }
  100% {
    transform: translate(0, 0);
    color: lightgray;
  }
}

.bingo-heart-inactive {
  border-width: 2px;
  animation: heart-lost 0.3s forwards;
}

.bingo-preview,
.bingo-student-gamearea {
  position: relative;
  width: 500px;
  margin: auto;
}

.bingo-preview-board-overlay,
.bingo-student-board-overlay {
  position: absolute;
  top: 0%;
  left: 0%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(transparent, gray);
}

.bingo-preview-board-play,
.bingo-student-board-play {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: deepskyblue;
  border: 4px solid white;
  text-align: center;
  font-size: 3em;
  color: white;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.bingo-preview-board-play:hover,
.bingo-student-board-play:hover {
  background: skyblue;
}

.bingo-student-board .bingo-cell:not(.bingo-mark):not(.bingo-mark-wrong):hover {
  background-color: #eee;
}

.bingo-student-board .bingo-cell {
  transition: background 0.1s;
}

.bingo-student-board .bingo-cell:not(.bingo-mark) {
  cursor: pointer;
}

.bingo-student-board .bingo-cell.bingo-mark-wrong {
  cursor: not-allowed;
}

.bingo-student-board .bingo-mark-wrong {
  background: tomato;
}

.bingo-student-board .bingo-mark-right {
  background: lightgreen;
}

.bingo-student-message {
  display: none;
  position: absolute;
  bottom: 92%;
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 6em;
  font-weight: bold;
  font-style: italic;
  white-space: nowrap;
  text-shadow:
    rgb(255, 255, 255) 3px 0px,
    rgb(255, 255, 255) -3px 0px,
    rgb(255, 255, 255) 0px 3px,
    rgb(255, 255, 255) 0px -3px;
  box-shadow:
    rgb(255, 255, 255) 0px 0px 5px,
    rgb(255, 255, 255) 0px 0px 10px,
    rgb(255, 255, 255) 0px 0px 15px,
    rgb(255, 255, 255) 0px 0px 20px,
    rgb(255, 255, 255) 0px 0px 25px,
    rgb(255, 255, 255) 0px 0px 30px;
  background: rgb(255, 255, 255);
  padding: 0 1ch;
}

body::backdrop {
  background: #fff;
}

@media all and (display-mode: fullscreen) {
  #navContainer,
  .newNaveSpace,
  .newNav,
  .navMainSpacer,
  .content,
  #footer {
    display: none;
  }

  #pageContent {
    max-width: unset;
    padding: 50px;
  }

  .bingo-header {
    display: none;
  }
}

:-webkit-full-screen #navContainer,
:-webkit-full-screen .newNaveSpace,
:-webkit-full-screen .newNav,
:-webkit-full-screen .navMainSpacer,
:-webkit-full-screen .content,
:-webkit-full-screen #footer {
  display: none;
}

:-webkit-full-screen #pageContent {
  max-width: unset;
}

:-webkit-full-screen .bingo-header {
  display: none;
}

.bingo-print-code {
  border: 1px solid #000;
  padding: 3px;
}

.bingo-print-questions {
  break-after: page;
}

.bingo-print-page {
  break-inside: avoid;
  display: grid;
  gap: 10px;
  /* font-size: 0.75em; */
  /* margin: 100px; */
}

@media not print {
  .bingo-print {
    width: 1000px;
    margin: auto;
  }

  .bingo-print:not(.bingo-print-show-preview) {
    display: none;
  }

  .bingo-print-questions {
    display: none;
  }

  .bingo-print-page {
    gap: 25px;
    margin-bottom: 25px;
    margin-inline: 100px;
  }

  /* .bingo-print-page:not(:first-child) { */
  .bingo-print-page {
    display: none;
  }
}

@media print {
  .bingo-main-hide-body > :not(.bingo-print) {
    display: none !important;
  }
}

.no-close .ui-dialog-titlebar-close {
  display: none;
}

.no-close.ui-dialog .ui-dialog-title {
  width: 100%;
}

#dialog-information-how-to-play p {
  margin-bottom: 10px;
}

#dialog-choose-mode {
  padding: 20px;
}

.bingo-mode {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.bingo-mode > button {
  /* text-align: center; */
  flex: 1;
}

.bingo-mode-icon {
  font-size: 3em;
}

.bingo-mode-label {
  font-size: 1.5em;
}

.bingo-mode-grade {
  text-align: center;
}

.bingo-mode-grade-level {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

#dialog-choose-mode .bingo-mode-grade-level > button {
  flex: 1;
  height: 50px;
  font-size: 1.5em;
}
