* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: sans-serif;
    background: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
}

img, video, canvas, svg { max-width: 100%; }

.page-header {
    padding: 2em 1em 1em;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: 2.4em;
    color: #264653;
}

.page-header p {
    margin: 0.3em 0 0;
    color: #888;
}

.page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
}

.page-footer {
    text-align: center;
    padding: 1em;
    color: #aaa;
}

.container {
    height: 240px;
    width: min(420px, 95vw);
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0 10px 20px #dbdbdb;
    font-family: sans-serif;
    background: #fff;
}

.palette {
    display: flex;
    height: 86%;
    width: 100%;
}

.color {
    height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: flex 0.15s linear;
    text-decoration: none;
    text-align: center;
    padding: 0.4em;
    overflow: hidden;
}

.color span {
    opacity: 1;
    transition: opacity 0.15s linear, font-size 0.15s linear;
    font-size: 0.72em;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.color span small {
    font-weight: 400;
    font-size: 0.85em;
    display: block;
    margin-top: 0.3em;
    opacity: 0;
    transition: opacity 0.15s linear;
}

.color:hover {
    flex: 2.5;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.color:hover span { font-size: 0.9em; }
.color:hover span small { opacity: 1; }

#stats {
    height: 14%;
    width: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5em;
    box-sizing: border-box;
    color: #bebebe;
    font-size: 0.85em;
}

#stats svg {
    fill: #bebebe;
    transform: scale(1.2);
}

/* ----- Responsive ----- */

@media (max-width: 700px) {
    .page-header { padding: 1.2em 0.8em 0.6em; }
    .page-header h1 { font-size: 1.8em; }
    .page-header p { font-size: 0.9em; }

    .container {
        width: 95vw;
        height: auto;
        min-height: 320px;
    }
    .palette {
        flex-direction: column;
        height: 88%;
    }
    .color {
        height: auto;
        flex: 1;
        min-height: 50px;
    }
    .color span {
        opacity: 1;
        font-size: 0.95em;
    }
    .color span small {
        opacity: 1;
        margin-top: 0.15em;
    }
    .color:hover { flex: 2; }
    #stats { height: auto; padding: 0.5em 1em; }
}

@media (max-width: 480px) {
    .page-header h1 { font-size: 1.5em; }
    .container { min-height: 360px; }
}
