
html, body {
	height: 100%;
}

body {
	margin: 0;
	display: flex;
	flex-direction: column;
}

#input {
	display: block;

	background-color: #e8e8e8;
	color: darkgray;
	border: none;
	outline: none;
	margin: 0;
	padding: 10px 15px;

	width: 100%;

	font-size: 24px;

	box-sizing: border-box;
}

#result {
	display: flex;

	background-color: #eeeeee;
	color: #444;
	flex-grow: 1;

	align-items: center;
	justify-content: center;
}

#result-span {
	font-family: sans-serif;
	font-size: 48pt;
	text-align: center;

	margin-top: -48px; /* -48px to counter ruby text */
}

.word {
	border-bottom-color: #999;
	border-bottom-width: 6px;
	border-bottom-style: solid;
	margin-right: 10px;

	position: relative;
}

/* WORD HIGHLIGHTING */

.noun {
	color: #99cc99;
}

.verb {
	color: #6699cc;
}

.adjective {
	color: #ffcc66;
}

.adverb {
	color: #f2777a;
}

.particle {
	color: #cc99cc;
}

.aux-verb {
	color: #66cccc;
}

.other {
	color: #a09f93;
}

.noun-back {
	background-color: #99cc99;
}

.verb-back {
	background-color: #6699cc;
}

.adjective-back {
	background-color: #ffcc66;
}

.adverb-back {
	background-color: #f2777a;
}

.particle-back {
	background-color: #cc99cc;
}

.aux-verb-back {
	background-color: #66cccc;
}

.other-back {
	background-color: #a09f93;
}

.popup .other {
	color: #f2f0ec;
}

.word .popup {
    visibility: hidden;
    width: 240px;
    background-color: #999;
    color: #eee;
    padding: 5px 5px;
    border-radius: 6px;
 
    position: absolute;
    z-index: 1;
    margin-top: 2px;
    top: 113%;
    left: 0;

	font-size: 11pt;
	text-align: left;
}

.word:hover {
    border-radius: 6px;
	background-color: #f8f8f8;
	border-bottom-width: 20px;
}

.word:hover .popup {
	visibility: visible;
}

.purpose {
	float: right;
	color: #f2f0ec;
	border-radius: 4px;
	padding: 2px 4px;
	font-size: 9pt;
	margin-left: 5px;
}

.popup ul {
	margin-top: 4px;
	margin-bottom: 4px;
	padding-left: 8px;
	padding-right: 8px;
	list-style-type: none;
}

.popup li {
	margin: 4px 0px;
}

.note {
	font-size: 8pt;
	color: #fff7;
	font-weight: bold;
	text-transform: uppercase;
	float: right;
}

.note a {
	color: #fffb;
}

footer {
	text-align: right;
	padding: 1px 16px;
	background-color: #e8e8e8;
	color: darkgray;

	font-family: sans-serif;
	font-size: 10pt;
}

footer a {
	color: #666b;
}

.unknown {
	color: #fff8;
	font-weight: bold;
}

.reading {
	font-style: italic;
}


/* --- Kanji popup style --- */
.kanji .popup2 {
  background-color: #dbdbdb;
  width: 316px;
  display: grid;
  grid-template: 1fr / 1fr 80px;
  border-radius: 6px;
  color: #444;
}

.kanji .primary {
}

.kanji .primary .top {
  display: grid;
  grid-template: 60px 1fr / 60px 1fr;
}

.kanji .character {
  font-size: 42px;
  font-family: serif;
  margin: 0px 10px;
}

.kanji .meaning {
  font-family: sans-serif;
  margin: 10px 10px;
  width: 110px;
  overflow: hidden;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.kanji .frequency {
  font-family: sans-serif;
  font-size: 11px;
  margin-left: 12px;
  margin-right: 8px;
  text-align: center;
  color: #888;
}

.kanji .bottom {
  display: grid;
  grid-template: 1fr / 1fr 1fr;
  font-family: sans-serif;
}

.bottom div {
  padding: 0px 10px;
}

.kanji .secondary {
  display: grid;
  grid-template: 1fr 1fr 1fr / 1fr;
  text-align: center;
  font-family: sans-serif;
}

.bottom h5 {
  margin: 8px 4px;
}

.secondary h5 {
  margin-top: 12px;
  margin-bottom: 8px;
}

h5 {
  color: #666;
  text-transform: uppercase;
  /*padding-top: 8px;
  padding-bottom: 6px;*/
  text-align: center;
}

.secondary div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding-bottom: 5px;
}

.kanji .popup2 {
    visibility: hidden;
    width: 316px;
 
    position: absolute;
    z-index: 1;
    
    bottom: 175%;
    left: 50%;
    margin-left: -158px;

	font-size: 11pt;
	text-align: left;
	padding: 5px;
}

.kanji:hover {
	background-color: #dbdbdb;
    border-radius: 6px;
}

.kanji:hover .popup2 {
	visibility: visible;
}

.kanji {
	display: inline;
	position: relative;
}

.kanji .popup2::after {
    content: " ";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #dbdbdb transparent transparent transparent;
}

/* difficulty colours */
/*
.back-lv1 {
	background-color: #22b8f5;
}
.back-lv2 {
	background-color: #3da2de;
}
.back-lv3 {
	background-color: #588dc8;
}
.back-lv4 {
	background-color: #7378b1;
}
.back-lv5 {
	background-color: #8d639c;
}
.back-lv6 {
	background-color: #a74f86;
}
.back-lv7 {
	background-color: #c2396f;
}
*/