html {
  height: 100%;
}

body {
  background-color: #0d659d;
  color: #0c4160;
  margin: 0px;
  padding: 2.4vmin;
}

div.hidden {
  visibility: hidden;
}

div#loading-panel {
  position: absolute;
  color: #c3ceda;
  height:0px;
  top: calc(50vh - 40px);
  left: calc(50vw - 40px);
}

div#app-layout {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2.4vmin;
}

div#toolbar {
  height: 8.4vmin;    
  width: 95.2vmin; 
  gap: 3.6vmin;
  box-sizing: border-box; /* This helps as the grid is not padded so makes lining up easier */
  padding: 1.2vmin;
  border:1px solid #0c4160;
  background-color: #c3ceda;
  display:flex;
  align-items: center;
}

div#grid-viewer {
  width: 95.2vmin;
  overflow: scroll;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
}

div#clue-controls {
  width: 95.2vmin;
  height: 10vmin;
  box-sizing: border-box; /* This helps as the grid is not padded so makes lining up easier */
  padding: 1.2vmin;
  border:1px solid #0c4160;
  background-color: #c3ceda;
  display:flex;
  align-items: center;
  gap: 2.4vmin;
}

/* Keyboard / keypad styles */
div#keyboard {
  width: 95.2vmin;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  user-select: none;
}

/* Grid layout styles */
div#grid {
  aspect-ratio: 1/1;
  width: 100%;
  font-size: 5.4vmin;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  background-color: #c3ceda;
  border:1px solid #0c4160;
  user-select: none;
}

div.sub-grid {
  aspect-ratio: 1/1;
  width: 33.33%;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  background-color: #c3ceda;
  border:1px solid #0c4160;
  user-select: none;
}

div.grid-row {
  flex-basis: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
}

div.cell {
  border: 1px solid #738fa7;
  focus: outline-none;
  flex-basis: 0;
  flex-grow: 1;
  min-width: 20px;
  min-height: 20px;
  display: grid;
  touch-action: manipulation;
}

/* Transition effect when a cell has been externally modified */
@keyframes cell-updated-by-other {
  from {outline: 3px solid #6ecf4b;}
  to {outline: none;}
}

div.cell-updated-by-other {
  animation-name: cell-updated-by-other;
  animation-duration: 5s;
}

div:focus {
  outline-width: 1px;
  outline-style: solid;
  outline-color: #738fa7;
}

div.cell-active-clue {
  background-color: #feb470;
  font-color: #0c4160;
}

div.cell-active-readonly {
  background-color: #b8b8b8;
  font-color: #0c4160;
}

div.cell-active {
  background-color: #fe881b;
  font-color: #0c4160;
}

div.cell-filled {
  background-color: #0c4160;
}

div.cell-content {
  text-align: center;
  grid-row-start: 1;
  grid-column-start: 1;
  display: flex;
  align-items: center;
  justify-content: center;  
  touch-action: manipulation;
}

div.grid-number {
  font-size: 75%;
  margin: 0px;
  line-height: 0.7;
  padding: 0.2vmin;
  grid-row-start: 1;
  grid-column-start: 1;
  touch-action: manipulation;
}

/* Tool bar and clue bar styles */
div#toolbar-title {
  font-size: 4.5vmin;
  font-weight: bold;
  flex-grow: 1;
}

div#toolbar-settings, div#toolbar-help {
  font-size: 6vmin;
  font-weight: bold;
}

div#clue-content {
  flex-grow: 1;
  text-align: center;
  font-size: 3.2vmin;
}

div#previous-clue, div#next-clue {
  font-size: 6.4vmin;
  font-weight: bold;
  user-select: none;
}

div.keyboard-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

div.numeric-keyboard {
  gap: 2.4vmin;
}

div.alphabetic-keyboard {
  gap: 1.2vmin;
}

button.keyboard-key {
  font-family: serif;
  position: relative;
  display: block;
  box-sizing: border-box;
  background-color: #90a5bb;
  padding: 1.2vmin;
  border: 1px solid #0c4160;
  text-align: center;
  overflow: hidden;
  touch-action: manipulation;
}

button.alphabetic-keyboard {
  width: 8.4vmin;  
  font-size: 6vmin;
}

button.numeric-keyboard {
  width: 15vmin;
  font-size: 8vmin;
}

button.keyboard-key:disabled {
  background-color: #a0a0a0;
}

button.keyboard-key:after {
  content: "";
  background-color: #fff;
  display: block;
  position: absolute;
  top: 0px;
  left: 0px;
  padding: 100%;
  opacity: 0;
  transition: all 0.5s;
}

button.keyboard-key:active:after {
  opacity: 0.5;
  transition: 0s;
}

div#message-panel {
  background: rgba(127, 127, 127, 0.7);
  position:fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}

div#message-content {
  border:1px solid #0c4160;
  background-color: #c3ceda;
  padding: 3.6vmin;
  font-size: 6vmin;
  font-weight: bold;
}

