* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

html, body, button {
    font-family: sans-serif;
    font-size: 0.9em;
}

/* Day */
@media (prefers-color-scheme: light) {
    body {
        background-color: #dddddd;
        color: #222222;
    }
    header {
        background-color: lightgray;
        color: #333333;
    }
    header button {
        background-color: #eeeeee;
    }
    header button:hover {
        background-color: #cccccc;
    }
    main {
        background-color: #eeeeee;
        color: #222222;
    }
    td:hover {
        background-color: #dddddd;
    }
    td span.char.spec {
        color: teal;
    }
    td span.code {
        color: #bbbbbb;
    }
    .search-wrapper .clear {
        background-color: #eeeeee;
    }
}

/* Night */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #222222;
        color: #dddddd;
    }
    header {
        background-color: #333333;
        color: #eeeeee;
    }
    header button {
        background-color: #aaaaaa;
    }
    header button:hover {
        background-color: #dddddd;
    }
    main {
        color: #eeeeee;
        background-color: #3c3c3c;
    }
    td:hover {
        background-color: #555555;
    }
    td span.char.spec {
        color: cyan;
    }
    td span.code {
        color: #888888;
    }
    .search-wrapper .clear {
        background-color: #333333;
    }
}

.toolbar {
    display: flex;
    gap: 0.5em;
    flex-grow: 1;
    flex-wrap: wrap;
/*    font-size: 5em;*/
    align-items: center;
}

.home {
    font-weight: bold;
    font-size: 110%;
}

.red {
    color: red !important;
}

main {
    margin-top: 4em; /* put the same in the next line */
    height: calc(100vh - 4em);
    overflow-y: auto;
    padding: 0.3em;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4em; /* put the same in 'main' */
    padding: 0.6em;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 1em;
}

header h1 {
  color: chocolate;
  margin: 0;
}

.head-left {
    flex-shrink: 0;
}

header button {
    font-size: 1em;
    line-height: 1.6em;
    padding: 0 8px 0 8px;
    border: 1px solid gray;
    border-radius: 1em;
    transition: background-color 0.3s;
}

header input {
    border-radius: 1em;
    font-size: 105%;
    max-width: 6em;
    padding: 3px 6px;
    padding-right: 6px;
    border: 1px solid gray;
}

header input:focus {
    outline: none;
    box-shadow: 0 0 2px teal;
}

header input::placeholder {
    font-style: italic;
    color: gray;
    opacity: 0.8;
    transition: opacity 0.2s;
}

header input:hover::placeholder,
header input:focus::placeholder {
    opacity: 0;
}

.searchbox {
    position: relative;
    display: inline-block;
}

.searchbox input {
    border-radius: 1em;
    font-size: 105%;
    max-width: 6em;
    padding: 3px 6px;
    background-color: #cccccc;
    border: 1px solid gray;
    transition: outline 0.3s;
}

.searchbox button#clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: red;
    background-color: #cccccc;
    font-weight: bold;
    font-size: 1.2em;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    border-radius: 50%;
    width: 1.3em;
    height: 1.3em;
/*    cursor: pointer;*/
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.searchbox:hover input:not(:placeholder-shown) + button#clear {
    opacity: 1;
    pointer-events: auto;
}

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

td {
    position: relative;
    padding: 18px 4px 4px 4px;
    border: 1px solid #cccccc;
    transition: background-color 0.3s;
}

td span.char {
	display: block;
    font-size: 2.2em;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

td span.char.spec {
    font-size: 100%;
}

td span.code {
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 1em;
    font-family: monospace;
    pointer-events: none;
}

.hide {
	display: none;
}

.rot {
	animation: rot 0.6s
}

@keyframes rot {
  100% {transform: rotate(-360deg);}
}
