* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    margin: 0;
    padding: 1rem 2rem;
}

.main {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tab {
    display: none;
    padding: 2rem;
    border: 1px solid lightgrey;
    flex: 1 1;
}
.tab.selected {
    display: block;
}
.tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.tab-selector {
    border: 1px solid #ddd;
    border-bottom: 0;
    display: block;
    margin-left: 1rem;
    padding: 0.4rem 1rem;
    user-select: none;
    position: relative;
    background: #eee;
    transition: opacity 0.3s ease;
}
.tab-selector.selected {
    background: white;
}
.tab-selector.disabled {
    background: #ccc;
    color: #999;
}
.tab-selector.unlocked {
    animation: highlight 1s ease-out;
}
.tab-selector:not(.selected):not(.disabled):hover {
    background: #e9e9e9;
}
.tab-selector.selected:after {
    content: "";
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    left: 0;
    bottom: -1px;
    background: white;
}

footer {
    background: white;
    padding: 1rem;
    border-top: 1px lightgrey;
}

#account .warning {
    display: block;
    margin-bottom: 1rem;
}

#books > div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#books > div > * {
    text-align: center;
    margin: auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    font-size: 24px;
}

#books > div > .selected {
    border: 1px solid black;
}

/* *:hover doesn't work in quirks mode */
#books > div > *:hover {
    border: 1px solid #999 !important;
    background-color: #eee;
}

#books img {
    max-height: min(387px, 30vw, 30vh);
    max-width: min(387px, 30vw, 30vh);
}

#current-book {
    padding: 4px;
}

.pokemon-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 4px;
    justify-content: center;
}

.pokemon-link {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid black;
    padding: 4px;
    position: relative;
}

.pokemon-link.selected {
    border: 8px dashed orange;
}

.pokemon-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.pokemon-link:hover::after {
    opacity: 1;
}

.pokemon-link:has(img[src^="data:"]) {
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.1);
}

.pokemon-link > img {
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    flex: 1 1;
    object-fit: contain;
}

.pokemon-link > span {
    display: block;
    text-align: center;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    text-overflow: ellipsis;
}

#editor > div {
    display: flex;
    flex-direction: row;
}

#editor > div > * {
    margin: auto;
    text-align: center;
}

#editor .square {
    width: 400px;
    height: 400px;
    position: relative;
}

#editor .square > .art {
    left: 5%;
    top: 5%;
    width: 90%;
    height: 90%;
}
#editor .square > * {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

#editor .trace-area .art {
    opacity: 15%;
}

.hflex {
    display: flex;
    flex-direction: row;
}

.easel {
    display: block;
    padding: 20px;
    width: min-content;
    left: 0px;
}

.easel canvas {
    border: 1px dashed darkgreen;
}

.line-thickness {
    padding: 1rem;
    display: flex;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 10pt;
    align-items: center;
    margin: auto;
    width: fit-content;
    gap: 1rem;
}

.tool {
    height: 64px;
    width: 64px;
    box-sizing: border-box;
    flex: 0 1;
    margin: 0 auto;
    padding: 5px;
}
.tool:hover:not(.tool-selected) {
    background: rgba(0, 0, 255, 0.1);
}

.tool-selected {
    border: 2px red solid;
    padding: 2px;
}

@keyframes highlight {
    0% {
    background-color: #ffd700; /* gold highlight */
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  100% {
    background-color: #eeeeee;
    transform: scale(1);
    box-shadow: none;
  }
}

@media only screen and (max-width:800px) {
    .mode-trace .reference {
        display: none;
    }
}

@media only screen and (max-width:600px) {
    body {
        padding: 0;
    }
    .tab-selector {
        padding: 0.4rem 0.5rem;
        margin-left: 0;
    }
    footer {

    }
}

