@font-face {
  font-family: "Abadi";
  src: url("./fonts/AbadiMT.ttf") format("truetype");
}

@font-face {
  font-family: "Abadi ExtraBold";
  src: url("./fonts/AbadiMT-ExtraBold.ttf") format("truetype");
}

@font-face {
  font-family: "Abadi ExtraLight";
  src: url("./fonts/AbadiMT-ExtraLight.ttf") format("truetype");
}

.cell.r {
  background: #ff6464;
  border-radius: 5px;
}

.cell.b {
  background: #6464ff;
  border-radius: 5px;
}

/* only the two score boxes, not the 1024 squares on the board */
#box .cell {
  padding: 5px;
  border: 1px solid #000000;
}

#box {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 20px;

  /*font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;*/
  font-family: "Abadi ExtraBold", sans-serif;
}

#board {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 1px;
  aspect-ratio: 1;
  width: min(55vh, 520px);
  max-width: 90vw;
  background: #e9e6e1;
  justify-content: center;

}

.grid_square {
  background: #f7f5f2;
}

.grid_square.r {
  background: #DC2626;
}

.grid_square.b {
  background: #2563EB;
}

#board .cell {
  background: #f7f5f2;
  border-radius: 0;
}

#board .cell.r {
  background: #DC2626;
  border-radius: 0;
}

#board .cell.b {
  background: #2563EB;
  border-radius: 0;
}


.container .grid_square {
  background: #f7f5f2;
}

#center_ts_shit {
  display: flex;
  justify-content: center;
}
#mode {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

#mode button,
#lobby-actions button,
#screen-finished button {
  padding: 8px 18px;
  border: 1px solid #000000;
  border-radius: 4px;
  background: #f7f5f2;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

#mode button:hover,
#lobby-actions button:hover,
#screen-finished button:hover {
  background: #e5e2dd;
}

#mode button:active,
#lobby-actions button:active,
#screen-finished button:active {
  transform: scale(0.97);
}

/* Optional: aktiven Modus hervorheben, falls du z.B. per JS eine Klasse "active" setzt */
#mode button.active,
#mode button.selected {
  background: #2563EB;
  color: #ffffff;
  border-color: #2563EB;
}


#round-count {
  display: flex;
  justify-content: center;
  gap: 5px;
  font-family: 'Abadi', sans-serif;
}

#status {
  display: flex;
  justify-content: center;
  gap: 5px;
  font-family: 'Abadi', sans-serif;
}

#count-r {
    font-family: Abadi;
}

#count-b {
    font-family: Abadi;
}

#mode button {
  position: relative; /* nötig, damit der Tooltip relativ zum Button positioniert wird */
}

#mode button::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

/* erster Button: Tooltip am linken Rand ausrichten statt zentrieren */
#mode button:first-child::after {
  left: 0;
  transform: translateX(0);
}

/* letzter Button: Tooltip am rechten Rand ausrichten statt zentrieren */
#mode button:last-child::after {
  left: auto;
  right: 0;
  transform: translateX(0);
}

#mode button:hover::after {
  opacity: 1;
}


/* the three screens, only one is ever shown. showScreen() in render.js swaps them */
#screen-game,
#screen-finished {
  display: none;
}

#screen-lobby {
  text-align: center;
  font-family: "Abadi", sans-serif;
}

#lobby-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#lobby-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#lobby-box input {
  padding: 8px;
  border: 1px solid #000000;
  border-radius: 4px;
  background: #f7f5f2;
  font-size: 14px;
  font-family: "Abadi", sans-serif;
}

#name-input {
  width: 200px;
  text-align: center;
}

#room-input {
  width: 70px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#lobby-error {
  color: #DC2626;
  min-height: 20px;
  margin-top: 8px;
}

/* only shown once a room exists, game.js switches it on */
#waiting-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
}

#room-code {
  font-family: "Abadi ExtraBold", sans-serif;
  font-size: 52px;
  letter-spacing: 8px;
  line-height: 1.1;
}

/* the code stays readable while the game is running */
#room-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-family: "Abadi", sans-serif;
}

#game-room-code {
  font-family: "Abadi ExtraBold", sans-serif;
  letter-spacing: 2px;
}

#screen-finished {
  text-align: center;
  font-family: "Abadi", sans-serif;
}

#screen-finished button {
  margin-top: 10px;
}


/* the whole thing should fit on the screen without scrolling. the board is
   measured against the window height, so it shrinks before the page does */
body {
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
}

h1 {
  margin: 4px 0 8px 0;
}

h2 {
  margin: 12px 0 6px 0;
}

#mode {
  margin-top: 6px;
}
