/* Mike says: make the "good" color more saturated the more points it's worth. */
:root {
    --background: #111;
    --item-background: #222;
    --item-background-hover: #333;
    --text: #fff;
    --button-text: #fff;
    --good: #95de8e;
    --bad: #da3b3b;
    --warn: #f1a81c;
    --highlight: #ACE;
    --highlight-text: #333;
    --action-button: #214da2;
    --game-timer: 180s;
}

.theme-light {
    --background: #FFF;
    --item-background: #EEE;
    --item-background-hover: #DDD;
    --text: #000;
    --good: #2e8826;
    --highlight: #000;
    --highlight-text: #FFF;
    --button-text: #FFF;
    --action-button: #508af8;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}
.flex-column {
    flex-direction: column;
}
.flex-column-reverse {
    flex-direction: column-reverse;
}

html, body {
    background: var(--background);
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: var(--text);
}

#info-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#word-list {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column-reverse;
}

#word-chain {
    font-size: 2rem;
    transition: all ease 0.2s;
}
#word-chain.incomplete {
    color: var(--text);
}
#word-chain.valid {
    color: var(--good);
}
#word-chain.invalid {
    color: var(--bad);
}
#word-chain.duplicate {
    color: var(--warn);
}

#tiles-grid {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    touch-action: none !important;
}

#tiles-grid.pregame .tile-content {
    filter: blur(8px);
}

.tile-row {
    --tile-size: 64px; /* TODO: This should probably be based on screen size. */
    display: flex;
    justify-content: center;
    align-items: center;
}

.tile {
    position: relative;
    width: var(--tile-size);
    height: var(--tile-size);
    background: var(--item-background);
    margin: 4px; /* TODO: This should probably be based on screen size. */
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all ease 0.2s;
    cursor: pointer;
}
.tile:hover, .tile:focus {
    background: var(--item-background-hover);
}
.tile.chained {
    background: var(--highlight);
    color: var(--highlight-text);
}

.tile-content {
    font-size: 2rem; /* TODO: This should probably be based on screen size. */
    user-select: none;
}

.scored-word {
    color: var(--good);
    font-size: 0.85rem;
    margin: 2px;
    padding: 4px;
    border-radius: 2px;
}
.scored-word:focus, .scored-word:hover {
    background: var(--item-background);
    cursor: pointer;
    transition: all ease 0.2s;
}
.scored-word.points-2 {
    filter: saturate(1.50);
}
.scored-word.points-3 {
    filter: saturate(2.00);
}
.scored-word.points-4 {
    filter: saturate(3.00);
}
.scored-word.points-5 {
    filter: saturate(4.00);
}
.scored-word.points-11 {
    animation-duration: 3s;
    animation-name: rainbow-cycle;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes rainbow-cycle {
    0% {
        filter: saturate(5) hue-rotate(0deg);
    }
    100% {
        filter: saturate(5) hue-rotate(360deg);
    }
}

#pregame-overlay {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

button {
    padding: 8px;
    background: var(--action-button);
    border-radius: 4px;
    cursor: pointer;
    color: var(--button-text);
    border: none;
    transition: all ease 0.2s;
}
button:hover {
    filter: brightness(1.25);
}
button:disabled {
    filter: saturate(0.33);
    cursor: not-allowed
}

#pregame-overlay button {
    font-size: 2rem;
    margin: 16px;
    width: 256px;
}


#timer {
    margin: 8px;
    position: relative;
    width: 256px;
    height: 8px;
}
#timer-bar {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: var(--item-background);
    border-radius: 4px;
}
#timer-slider {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--text);
    width: 0;
    height: 100%;
}
#timer-slider.ticking {
    width: 100%;
    transition: width linear var(--game-timer);
}

#game-over-message {
    margin: 4px;
    font-size: 2rem;
}

.hidden {
    display: none !important;
}

#post-game-button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 256px;
    margin: 8px;
}
#post-game-button-container button {
    width: 30%;
}

#copy-holder {
	position: fixed;
	left: 0;
	bottom: 0;
	transform: translateY(100%);
}

#theme-switcher-btn {
    height: 5vw;
    width: 5vw;
	min-height: 8px;
	max-height: 32px;
	max-width: 32px;
	min-width: 8px;
    border-radius: 50%;
    background: var(--background);
    filter: invert();
    position: fixed;
    right: 0;
    top: 0;
    margin: 8px;
    padding: 0;
    cursor: pointer;
    transition: all ease 0.5s;
    z-index: 100;
}
