:root {
    --free-space: #52a5f2;
    --tier-easy: #68835b;
    --tier-medium: #b87e38;
    --tier-hard: #b9322a;
    --reward: #283144;
}

body {
    margin: 0;
    padding: 20px;
    font-family: sans-serif;
    color: #eee;
    background-color: #222;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-16 {
    gap: 16px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
}

.controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--free-space);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: #4090d9;
}

.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.tile {
    position: relative;
    border-radius: 4px;
    cursor: pointer;
}

.tile::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tile::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 10;
}

.tile:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.tile:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

.tile img {
    width: 100%;
    height: auto;
    display: block;
}

.free-space {
    border: 3px solid var(--free-space);
    background-color: var(--free-space);
}

.easy {
    border: 3px solid var(--tier-easy);
    background-color: var(--tier-easy);
}

.medium {
    border: 3px solid var(--tier-medium);
    background-color: var(--tier-medium);
}

.hard {
    border: 3px solid var(--tier-hard);
    background-color: var(--tier-hard);
}

.reward {
    border: 3px solid var(--reward);
    background-color: var(--reward);
}
