h3 {
  color: #484;
  font-size: 1em;
}

#content * {
  -moz-box-sizing: border-box;
  -ms-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* Tab bar */

.tabbar {
  border-bottom: 1px solid #afc1e2;
  height: 1.8em;
  list-style: none;
  margin: 1em 0 0;
  padding: 0 0 0 1.5em;
}

.tabbar li {
  background: #e9f4fc;
  border: 1px solid #afc1e2;
  float: left;
  height: 1.8em;
  margin: 0 .4em 0 0;
  overflow: hidden;
  padding: 0;
  white-space: nowrap;
}

.tabbar li.selected {
  background: #fff;
  border-bottom: none;
}

.tabbar li a {
  display: block;
  line-height: 1.8em;
  outline: none;
  overflow: hidden;
  padding: 0 .8em;
  white-space: nowrap;
}

.tabbar li a:link,
.tabbar li a:visited,
.tabbar li a:hover,
.tabbar li a:active {
  color: #00c;
  text-decoration: none;
}

.tabbar li a:active {
  color: #f00;
}

.tabbar li.selected a {
  color: #000;
  font-weight: bold;
}

/* Tab content */

.toybox > div {
  display: none;
}

.toybox > div.selected {
  display: block;
}

/* Introduction tab */

#introduction > p {
  margin: 1em;
}

#introduction > div {
  padding: 0 0 1em;
}

#intro-video {
  height: 246px;
  margin: auto;
  position: relative;
  width: 425px;
}

#intro-video .now-loading {
  border: 1px solid #ccc;
  height: 100%;
  width: 100%;
}

#intro-video > iframe {
  border: none;
  height: 246px;
  left: 0;
  position: absolute;
  top: 0;
  width: 425px;
}

/* How-to-use tab */

#how-to-use p {
  margin: 1em;
}

#how-to-use .example img {
  display: block;
  margin: auto;
  /* Cancel "float: left" for "#content img" defined in
     http://www.google.com/tools/dlpage/res/c/css/dlpage.css */
  float: none;
}

#hu-first-mission {
  padding: 0 1em 1em;
}

#hu-keying-guide-pane {
  background-color: #eee;
  margin: 0 3em;
  padding: .7em;
}

#hu-keying-guide-play .keying-guide-play-button {
  vertical-align: text-bottom;
  margin: 0 0 0 .4em;
}

#hu-coaching-message {
  margin: .2em 0 0 3em;
}

#hu-morse-key-device-pane {
  margin: 1.6em 0 0;
  text-align: center;
}

/* Free input tab */

#free-input {
  padding: 1.2em 1em 0;
}

#fi-reference-pane {
  background-color: #eee;
  padding: .7em;
}

#fi-text-to-key-text {
  width: 100%;
  height: 2em;
}

#fi-text-to-key-error {
  color: #c11;
}

#fi-keying-guide-pane {
  display: none;
  margin: 1.8em 0 0;
}

#fi-keying-guide-play .keying-guide-play-button {
  vertical-align: text-bottom;
  margin: 0 0 0 .4em;
}

#fi-inline-input-pane {
  margin: 1.8em 0 0;
  padding: .7em;
}

#fi-inline-input-area {
  border: 1px solid #000;
  width: 100%;
  min-height: 3em;
  padding: .18em;
}

#fi-inline-input-area:focus > #fi-inline-cursor.cursor-blink {
  border-left: 1px solid #000;
}

#fi-inline-input-area > div {
  text-align: right;
  width: 100%;
}

#fi-reset-button {
  background: url(morse.png);
  background-position: -20px -18px;
  display: inline-block;
  height: 14px;
  margin: 0 2px 1px;
  width: 13px;
}

#fi-reset-button:active {
  margin: 1px 2px 0;
}

#fi-reset-button:hover,
#fi-reset-button:active {
  cursor: pointer;
}

#fi-coaching-message {
  margin: .2em 0 0;
}

#fi-morse-key-device-pane {
  margin: 2em 0 0;
  text-align: center;
}

/* Keying game tab */

#keying-game {
  padding: 1.2em 0 0;
  text-align: center;
}

#keying-game h3 .waka-upper-phrase {
  padding: 0 2em 0 0;
}

#keying-game h3 .waka-lower-phrase {
  padding: 0 0 0 2em;
}

#keying-game h3 span {
  display: inline-block;
  margin: 0 .3em;
}

#kg-waka-pane > div,
.waka-unit > div {
  display: inline-block;
}

#kg-waka-pane {
  margin: .6em 0 0;
}

.waka-unit {
  margin: .4em 0;
}

.waka-kana {
  color: #444;
  font-size: 50%;
}

.waka-kana > span > span {
  display: inline-block;
  text-align: center;
}

.waka-kanji > span > span {
  display: inline-block;
  margin: 0 .4em;
}

.waka-author {
  font-size: 85%;
  margin: 1em 0 0;
}

.waka-author .waka-kanji > span > span {
  margin: 0 .2em;
}

#kg-waka-unit1 {
  text-align: left;
}

#kg-waka-unit2 {
  text-align: center;
}

#kg-waka-unit3 {
  padding: 0 0 0 8em;
  text-align: right;
}

#kg-waka-unit4 {
  padding: 0 0 0 2em;
  text-align: left;
}

#kg-waka-unit5 {
  padding: 0 0 0 8em;
  text-align: right;
}

#kg-waka-author {
  padding: 0 1em 0 0;
  text-align: right;
}

#kg-keying-guide-pane {
  margin: -5em 0 0;
}

#kg-keying-guide-pane * {
  vertical-align: top;
}

#kg-keying-guide-pane > div > div {
  display: inline-block;
  margin: 0 0 .5em;
  position: relative;
}

.ninja #kg-keying-guide-play1,
.ninja #kg-keying-guide-play2 {
  display: none;
}

.ninja #kg-keying-guide-pane .blindfold {
  background: url(blindfold.png) repeat-x;
  position: absolute;
  left: 0;
  top: 0;
  height: 32px;
  width: 100%;
}

#kg-keying-guide-pane .morse-letter {
  visibility: hidden;
}

#kg-keying-guide-pane .morse-done .morse-letter {
  visibility: visible;
}

.ninja #kg-keying-guide-pane .morse-letter {
  visibility: visible;
}

#kg-next-game-pane {
  height: 4em;
  margin: -3em 0 0;
}

#kg-score-pane > table {
  color: #444;
  display: inline-block;
  text-align: right;
}

#kg-score-pane.best-score-updated > table .best-score-board {
  color: #c00;
  font-weight: bold;
}

#kg-score-pane > table td {
  padding: .2em;
}

#kg-score-pane > table td.score-label {
  padding-left: 1em;
}

#kg-morse-key-device {
  margin: 1.8em 0 0;
}

/* Common settings between free input and keying game */

.coaching-message {
  color: #c11;
  height: 1em;
  overflow: visible;
}

.coaching-message .morse-code {
  margin: 0 0.4em;
}

.morse-key-device-pane {
  background: #f3f3f3;
  background: -moz-linear-gradient(top, #eee, #ddd);
  background: -ms-linear-gradient(top, #eee, #ddd);
  background: -o-linear-gradient(top, #eee, #ddd);
  background: -webkit-linear-gradient(top, #eee, #ddd);
  background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ddd));
  background: linear-gradient(top, #eee, #ddd);
  border-bottom: 2px solid #bbb;
  border-left: 1px solid #ddd;
  border-right: 2px solid #bbb;
  border-top: 1px solid #ddd;
  -moz-border-radius: 20px;
  -ms-border-radius: 20px;
  -o-border-radius: 20px;
  -webkit-border-radius: 20px;
  border-radius: 20px;
  display: inline-block;
  padding: 1em 2em;
}

.morse-key-device-pane:hover,
.morse-key-device-pane:active {
  cursor: pointer;
}

.morse-key-device {
  background: url(morsekey.png);
  height: 120px;
  width: 150px;
  margin: auto;
  position: relative;
}

.morse-key-device-pane:active .morse-key-device,
.morse-key-device-pane.touch-active .morse-key-device {
  background-position: 0 -120px;
}

.morse-key-device-arrow {
  background: url(clickhere.gif);
  position: absolute;
  top: -22px;
  left: 2px;
  width: 40px;
  height: 55px;
}

.morse-key-device-pane:hover .morse-key-device-arrow,
.morse-key-device-pane:active .morse-key-device-arrow {
  display: none;
}

.morse-key-device-message {
  font-size: .8em;
  margin: .4em 0 0;
}

.morse-key-device-message > span {
  display: block;
}

/* Morse code */

.keying-guide-play-button {
  background: url(morse.png);
  background-position: -20px 0;
  display: inline-block;
  width: 16px;
  height: 16px;
}

.keying-guide-play-button:hover,
.keying-guide-play-button:active {
  cursor: pointer;
}

.morse-playing .keying-guide-play-button {
  background-position: -38px 0;
}

.morse-unit {
  display: inline-block;
  margin: 0 .6em 0 0;
}

.morse-unit * {
  vertical-align: top;
}

.morse-unit > * {
  display: block;
}

.morse-unit .morse-expected {
  margin: 6px 0 0;
  height: 1em;
  text-align: left;
}

.morse-code.morse-user-input {
  width: 1px;
  height: 1em;
  overflow: visible;
}

.morse-code {
  white-space: nowrap;
}

.morse-signal {
  display: inline-block;
  height: 7px;
}

.morse-dit {
  background: url(morse.png);
  background-position: 0 0;
  width: 6px;
}

.morse-dah {
  background: url(morse.png);
  background-position: -6px 0;
  width: 12px;
}

.morse-user-input .morse-dit.morse-valid,
.coaching-message .morse-dit {
  background-position: 0 -7px;
}

.morse-user-input .morse-dah.morse-valid,
.coaching-message .morse-dah {
  background-position: -6px -7px;
}

.morse-user-input .morse-dit.morse-invalid {
  background-position: 0 -14px;
}

.morse-user-input .morse-dah.morse-invalid {
  background-position: -6px -14px;
}

.morse-dit.morse-playing {
  background-position: 0 -21px;
}

.morse-dah.morse-playing {
  background-position: -6px -21px;
}

.morse-short-gap {
  display: none;
  width: 6px;
}

.morse-user-input .morse-short-gap.morse-invalid {
  display: inline-block;
  background: #d50f25;
}

.morse-letter {
  text-align: center;
}

.morse-done .morse-letter {
  color: #009925;
  font-weight: bold;
}

/* Morse code in text */

p .dit,
p .dah,
.morse-table .dit,
.morse-table .dah {
  background: url(morse.png);
  display: inline-block;
  height: 7px;
  margin: -4px 0 0;
  vertical-align: middle;
}

p .dit,
.morse-table .dit {
  background-position: 0 -7px;
  width: 6px;
}

p .dah,
.morse-table .dah {
  background-position: -6px -7px;
  width: 12px;
}

p .signals {
  margin: 0 .2em;
  white-space: nowrap;
}

/* Morse code table */

.morse-table table {
  font-size: .8em;
  margin: 1em 0;
  width: 100%;
}

.morse-table td {
  border: 1px solid #eee;
  padding: 4px 0 3px;
  font-weight: bold;
  color: #226;
  text-align: center;
}

.morse-table td > span {
  display: block;
  white-space: nowrap;
}

.morse-table-note {
  color: #666;
  font-size: .8em;
}
