* {
    box-sizing: border-box;
}

body, input, button {
    font-size: 17px;
    line-height: 1.59;
    -webkit-font-smoothing: subpixel-antialiased;
    font-family:-apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    text-rendering: optimizeLegibility;
    font-weight:400;
}

body {
    margin: 0 auto;
    max-width: 800px;
    padding: 1em;
}

body.dialog-open {
    overflow: hidden;
}

body.rules-open #rules-underlay {
    display: block;
}

body.settings-open #settings-underlay {
    display: block;
}

header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

h2 {
    margin: 0;
}

#menu {
    display: flex;
    column-gap: .5em;
}

#menu button,
.dialog-close {
    background: transparent;
    border: none;
    padding: 0;
}

#menu button svg {
    height: 1.5em;
    width: 1.5em;
}

.dialog-underlay {
    background: rgba(0,0,0,.5);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
}

.dialog {
    background: white;
    left: 2em;
    margin-bottom: 2em;
    margin-left: auto;
    margin-right: auto;
    max-width: 40em;
    overflow: hidden;
    position: fixed;
    right: 2em;
    top: 2em;
    z-index: 1;
}

.dialog-close {
    color: black;
    font-size: 1.5em;
    height: 1em;
    line-height: 1em;
    right: .5em;
    position: absolute;
    top: .5em;
    width: 1em;
    z-index: 2;
}

.dialog-content {
    max-height: calc(100vh - 4em);
    padding: 2em;
    overflow: auto;
}

.dialog-content > *:first-child {
    margin-top: 0;
}

.dialog-content > *:last-child {
    margin-bottom: 0;
}

#error {
    color: #f00;
}

#guess-wrapper {
    display: flex;
    margin: 20px 0;
    align-items: center;
}

#guess-wrapper input,
#give-up-btn {
    height: 2.5em;
    padding: .5em;
}

#hint-btn {
    height: 2.5em;
    padding: .5em;
}

#guesses {
    margin-bottom:40px;
}

#guess {
    width: 100%;
}

th {
    padding-right: 3em;
    text-align: start;
}

th.top1k {
    width: 100px;
    padding-right: 0em;
    text-align: center;
}

td.top1k {
    width: 100px;
    text-align: center;
}

th#chronoOrder, th#alphaOrder, th#similarityOrder, input:not([type=text]), button {
    cursor: pointer;
}

.gaveup {
    border: 1px solid black;
    margin-bottom: 1em;
    padding: 1em;
    background-color: #eeeeff;
}

.gaveup > *:first-child {
    margin-top: 0;
}

.close {
    text-align: left;
}

.percentile,
.progress-container,
.progress-bar {
    display: inline-block;
}

.percentile {
    text-align: right;
    width: 5em;
}

.progress-container {
    background-color: #eeeeee;
    width: 10em; 
}

.progress-bar {
    background-color:#008000;
}

/*"Unusual word found!  This word is not in the list of \"normal\" words that we use for the top-1000 list, but it is still similar!";*/

.weirdWord {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted black;
}

.weirdWord .tooltiptext {
 visibility: hidden;
  width: 20em;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 0.3ex 0;
  border-radius: 1ex;

  position: absolute;
  z-index: 1;
}


.weirdWord:hover .tooltiptext {
  visibility: visible;
}

footer {
    margin-top: 200px;
}

@media only screen and (max-width: 640px) {
    body, input, button {
        font-size: 14px;
    }

    table {
        width: 100%;
    }

    th {
        padding-right: .5em;
    }
}

/* Dark mode */
body.dark {
    background: #111;
    color: #fafafa;
    color-scheme: dark;
}

body.dark a {
    color: #9af;
}

body.dark #menu button {
    color: #fafafa;
}

body.dark .dialog {
    background: #333;
}

body.dark .dialog-close {
    color: #fafafa;
}

body.dark .progress-container {
    background: #333;
}

body.dark .gaveup {
    background: #334;
}

body.dark .weirdWord {
    border-color: #fafafa;
}
