.app {
    max-width: 760px;
    margin: 48px auto;
    padding: 0 24px;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.app-logo {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    object-fit: contain;
}

.app-title {
    min-width: 0;
}

.panel {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
}

.game-area {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
}

.puzzle-fallback {
    width: min(420px, 100%);
    margin: 18px auto 4px;
    border: 1px solid var(--color-state-error-border);
    border-radius: 12px;
    padding: 22px;
    background: var(--color-state-error-bg);
    color: var(--color-state-error-text);
    text-align: center;
}

.puzzle-fallback[hidden] {
    display: none;
}

.puzzle-fallback h2 {
    margin: 0;
    color: inherit;
    font-size: 22px;
    line-height: 1.15;
}

.puzzle-fallback p {
    margin: 8px 0 0;
    color: inherit;
    line-height: 1.45;
}

.puzzle-fallback-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.puzzle-fallback-actions button {
    min-height: 40px;
    white-space: normal;
}

.puzzle-fallback-secondary-action {
    border: 1px solid var(--color-state-error-border);
    background: var(--color-surface);
    color: var(--color-state-error-text);
}

.puzzle-fallback-secondary-action:hover {
    background: var(--color-surface-muted);
}

.app-footer {
    max-width: 100%;
    margin-top: 14px;
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    opacity: 0.72;
    overflow-wrap: anywhere;
}

.tutorial-callout {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition:
            border-color 0.15s ease,
            transform 0.15s ease,
            box-shadow 0.15s ease;
}

.tutorial-callout:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    text-decoration: none;
}

.tutorial-callout:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.tutorial-callout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--color-primary);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.tutorial-callout-text {
    display: block;
    min-width: 0;
}

.tutorial-callout-text strong {
    display: block;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.1;
}

.tutorial-callout-text span {
    display: block;
    margin-top: 1px;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.2;
}

@media (max-width: 640px) {
    .app {
        margin: 24px auto;
        padding: 0 16px 56px;
    }

    .app-header {
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 18px;
    }

    .app-logo {
        width: 52px;
        height: 52px;
    }

    .tutorial-callout {
        width: 100%;
        margin-top: 10px;
        padding: 9px 12px;
    }

    .panel {
        padding: 18px 14px;
    }

    .puzzle-fallback {
        padding: 18px 14px;
    }

    .puzzle-fallback-actions {
        flex-direction: column;
    }

    .puzzle-fallback-actions button {
        width: 100%;
    }
}
