* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
    background: #5eb3f6;
    color: #1a1a1a;
}

.game-wrap {
    text-align: center;
    padding: 1.5rem;
}

.game-nav {
    margin: 0 0 0.5rem;
}

.game-nav a {
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
}

.game-nav a:hover {
    text-decoration: underline;
}

h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
}

.hint {
    margin: 0 0 0.5rem;
    color: #333;
}

.look-label {
    margin: 0 0 1rem;
    font-weight: 600;
    color: #222;
}

kbd {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border: 1px solid #888;
    border-radius: 4px;
    background: #eee;
    font-family: inherit;
    font-size: 0.9em;
}

.hint--build {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.build-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}

.build-btn {
    padding: 0.35rem 0.7rem;
    border: 2px solid #666;
    border-radius: 6px;
    background: #eee;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.build-btn:hover {
    background: #fff;
    border-color: #2196f3;
}

.build-btn--active {
    background: #fff;
    border-color: #1565c0;
    box-shadow: inset 0 0 0 1px #1565c0;
}

.soft-color-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.65rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #ccc;
}

.soft-color-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.soft-color-name {
    min-width: 4.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.soft-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.soft-color-chip {
    width: 2.1rem;
    height: 1.35rem;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.soft-color-chip:hover {
    border-color: #1565c0;
    transform: translateY(-1px);
}

.soft-color-chip--active {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.35);
}

#game {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 3px solid #2e2e2e;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    outline: none;
}

#game:focus {
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.6);
}

.level-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 0.75rem;
}

.level-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

#level-name {
    width: 9rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid #888;
    border-radius: 4px;
    font: inherit;
}

#level-list {
    min-width: 8rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid #888;
    border-radius: 4px;
    font: inherit;
}

.level-bar button {
    padding: 0.35rem 0.75rem;
    border: 1px solid #666;
    border-radius: 4px;
    background: #eee;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.level-bar button:hover {
    background: #fff;
}

.level-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1565c0;
}

.controls-link {
    color: #1565c0;
    font-weight: 700;
    text-decoration: none;
}

.controls-link:hover {
    text-decoration: underline;
}

.game-stage {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.game-stage-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.stage-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid #666;
    border-radius: 6px;
    background: #eee;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.stage-btn:hover {
    background: #fff;
}

.stage-btn--ghost {
    background: #fff;
}

.game-stage:fullscreen {
    background: #5eb3f6;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.game-stage:fullscreen #game {
    width: min(98vw, calc(98vh * 4));
    height: auto;
    max-height: calc(98vh - 4rem);
    border-width: 4px;
}

.game-stage:fullscreen .game-stage-actions {
    margin-top: 0.85rem;
}
