body {
  font-family: 'Comic Sans MS', 'Comic Sans', "Chalkboard SE", sans-serif;
  margin: 0;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: linear-gradient(to bottom, #b0e39e, #a1c944);
  background-color: #f0f0f0;
}

h1 {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  color: red;
}

.mainContainer {
    display: flex;
    align-items: center;
    position: relative;
    gap: 40px;
}

.container {
  display: flex;
  align-items: center;
  position: relative;
}

#templateContainer {
    border: 1px solid black;
    border-radius: 10px;
    padding: 10px;
    background-color: #efefef;
    width: 100%;
}

.label-y {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 24px;
  font-weight: bold;
  margin-right: 10px;
  color: blue;
}

table {
  border-collapse: collapse;
  width: 100%;
  height: calc(100vh / 6 );
}

td {
  border: 1px solid #ccc;
  text-align: center;
  vertical-align: middle;
  width: calc(100vh / 12);
  height: calc(100vh / 12);
  position: relative;
}

td img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-label-cell, .y-label-cell {
  font-size: 20px;
  font-weight: bold;
}

.x-label-cell {
  background-color: red;
  color: #fff2f2;
}

.y-label-cell {
  background-color: blue;
  color: #d0f0d0;
}

.inner-cell {
  background-color: white;
  font-size: 40px;
  font-weight: bold;
  color: #555;
}

.settingControls, .gridControls {
  display: flex;
  margin-top: 10px;
  margin-bottom: 10px;
  width:  100%;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 5px;
}

.reveal {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#reshuffleButton {
  background-color: #03a9f4;
  color: #010d4c;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 15px;
}

#reshuffleButton:hover {
  background-color: #00bcd4;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

#reshuffleButton:active {
  background-color: #003d80;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
}

.x-label-cell,
.y-label-cell {
  position: relative;
}

.x-label-cell::after,
.y-label-cell::after {
  font-size: 40px;
  font-weight: bold;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  visibility: hidden;
  pointer-events: none;
}

.x-label-cell::after {
  content: attr(data-c);
  color: #fff2f2;
  background-color: red;
}

.y-label-cell::after {
  content: attr(data-c);
  color: #d0f0d0;
  background-color: blue;
}

.x-label-cell.unrevealed::after,
.y-label-cell.unrevealed::after {
  visibility: visible;
}

.template-text {
  margin: 0 0 10px 30px;
  font-size: 30px;
  min-height: 33px;
}

.scores {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  margin-top: 50px;
}

.team-score {
  width: 120px;
  vertical-align: top;
  border: 1px solid black;
}

.team-name {
  text-align: center;
  width: 100%;
  font-size: 1.5em;
  font-weight: bolder;
  background-color: #334f12;
}

.score-button {
  font-size: 1em;
  margin: 5px;
}

input[type="text"] {
  border: none;
  padding: 0px;
  font-size: 3em;
  text-align: center;
  width: 100%;
  font-family: inherit;
  background: yellow;
  color: black;
}

input[readonly] {
  background: #efefef;
  color: black;
}

.blue-span {
  display: inline-block;
  border-bottom: 5px dashed blue;
  background-color: #ffffff;
  color: #0000ff00;
}

.red-span {
  display: inline-block;
  border-bottom: 5px dashed red;
  background-color: #ffffff;
  color: #ff000000;
}

#settingDiv {
  min-width: 581px;
}

#gridDiv {
  margin-top: 20px;
}

#tempDiv {
  min-height: 200px;
  margin-bottom: 35px;
}

@media (max-width: 550px) {
  table {
    height: unset;
  }

  td {
    width: calc(100vh / 25);
    height: unset; 
    padding: 5px;
  }

  .x-label-cell {
  writing-mode: vertical-lr;
  }

  .inner-cell {
    padding: 5px;
  }

  td img {
      object-fit: contain;
  }

  .mainContainer {
    display: block
  }

  #settingDiv {
    min-width: unset;
    max-width: 90%;
  }

  #tempDiv {
    min-height: unset;
    margin-bottom: unset;
  }

  .template-text {
    font-size: 20px;
  }

  .settingControls {
    gap: 0;
  }

  .scores {
    margin-top: 25px;
  }

  .score-controls {
    width: min-content;
  }

  .team-name {
    font-size: 1.2em;
  }

  #reshuffleButton {
    margin: unset;
  }
}