:root {
  --grid-height: 8;
  --grid-width: 8;
}

* {
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  overflow-y: hidden;
  display: flex;
}

#bodyLeft {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: calc(100vh * var(--grid-width) / (var(--grid-height) + 1));
  flex-shrink: 0;
}

header {
  display: flex;
  align-items: center;
}

h1 {
  flex-grow: 1;
  text-align: center;
  margin: 0 1vh;
  font-size: 4vh;
}

#topleft {
  flex-shrink: 0;
  font-size: 3vh;
}

#topleft input[type="checkbox"] {
  width: 2vh;
  height: 2vh;
  margin-right: 0;
  font-size: 4vh;
}

.sol {
  display: none;
  cursor: pointer;
  background-color: limegreen;
  padding: 0;
  font-size: 2vh;
  margin: 0 0.2vh;
}

#time {
  display: none;
  font-size: 3vh;
  margin-right: 1vh;
}

header img {
  top: 0.5vh;
  right: 0.5vh;
  height: 4vh;
}

table {
  height: 100%;
  border-collapse: collapse;
}

td {
  border: 1px solid black;
  position: relative;
  padding: 0;
}

td > span {
  position: absolute;
  left: 0;
  top: 0;
  font-size: calc(30vh / var(--grid-height));
  background: white;
}

td > input {
  width: 100%;
  margin-top: calc((30vh + 25vh * (1 - var(--font-scale, 1))) / var(--grid-height));
  text-align: center;
  font-size: calc(var(--font-scale, 1) * 50vh / var(--grid-height));
  text-transform: uppercase;
  background: transparent;
  border: 0;
  padding: 0;
  outline: none;
}

.circle:before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  border: 1px solid black;
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

.shaded {
  background-color: white; /* required so brightness filter turns into lightgrey */
  filter: brightness(83%);
}

.linkedTo {
  background-color: #ffd98e;
}

.sameWord {
  background-color: #a4abff;
}

.remoteChanged {
  background-color: #ffa4e1;
}

.shared {
  background-color: yellowgreen;
}

.focused {
  background-color: yellow;
}

.solCorrect {
  background-color: limegreen;
}

.solWrong {
  background-color: crimson;
}

.dark {
  background-color: #222; /* needs contrast to shaded */
}

#cluebar {
  display: flex;
  align-items: center;
  background-color: #a4abff;
  height: calc(min(100vh / var(--grid-height), 10vh));
  overflow-wrap: anywhere;
}

#share {
  height: 100%;
  cursor: pointer;
}

#clue {
  width: 100%;
  text-align: center;
  font-size: calc(var(--font-scale, 1) * 80vh / var(--grid-height));
  margin-top: 2px;
  padding-left: 1vh;
  padding-right: 1vh;
}

#clue > input {
  border: 0;
  background-color: #a4abff;
  font-size: calc(min(80vh / var(--grid-height), 8vh));
  width: 57vh;
}

#goButton {
  background-color: yellow;
  padding: 0;
  font-size: calc(40vh / var(--grid-height));
  width: calc(100vh / var(--grid-height));
  height: 100%;
  float: right;
}

#bodyRight {
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  flex: 1;
  min-width: 20vh;
}

#clues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20vh, 1fr));
  font-size: 1.4em;
}

#clues h3 {
  margin: 0;
  font-size: 2vh;
  text-align: center;
}

#clues ol {
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
}

.wordDone {
  color: grey;
}

.wordDone a {
  filter: brightness(60%);
}

#clues textarea {
  width: 100%;
  margin: 0;
  resize: vertical;
  box-sizing: border-box;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: scroll;
}

#clues button {
  position: absolute;
  right: 2vh;
}

#measurer {
  width: auto;
  display: inline-block;
  visibility: hidden;
  position: fixed;
  overflow: auto;
}
